From: Intransition Date: 2010-08-29T05:32:48+09:00 Subject: Re: Name that method! On Aug 28, 11:10 am, Robert Dober wrote: > On Sat, Aug 28, 2010 at 4:59 PM, Intransition wrote: > > On Aug 27, 5:38 pm, Brian Candler wrote: > >> Module#enclosing_module ?? > > > Foo::Bar could be class. Does that make a difference? > > But a class is a module, right? Although more exactly one could argue > that an instance of a class is a module. Well for me that was good > enough an approximation. > As a side note I never use class_eval, but always module_eval. > However if some do not see a class as a (kind of a) module the name > would be chosen badly indeed. Your right it is, and that should suffice, though I recall matz once talking about the possibility of Module not being a subclass of Class in Ruby 2. Just the same, perhaps we can simplify it to just #enclosure ?