From: Christophe Grandsire Date: 2005-10-18T06:45:57+09:00 Subject: Re: Class/Method Filename En r�ponse � evronm : > > Is there any way to know the name of the file in which a class or > method was defined? > The problem is that classes in Ruby are open: they can be extended, even at runtime, and their definition can thus be spread on various files (and don't think it's an exceptional case. It's quite common for instance for standard libraries to add one or two methods in core classes). So "the name of the file in which a class was defined" doesn't mean much. For methods, it would be difficult too. I know there is __FILE__ which contains the name of the file you are currently in, so while you're running a method it points to the filename of the file the method is defined in. But unless the method itself uses __FILE__, you're out of luck... -- Christophe Grandsire. http://rainbow.conlang.free.fr You need a straight mind to invent a twisted conlang.