From: Logan Capaldo Date: 2006-04-19T11:12:40+09:00 Subject: Re: Nested scopes --Apple-Mail-20--398169967 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Apr 18, 2006, at 9:44 PM, Yoann Guillot wrote: > module Foo > def self.bar > puts "bar!" > end > > bar # works > > class Baz > # bar # doesn't work > # self.bar # doesn't work > Foo.bar # need to know the module name > end > end > > I'd like to be able to call the method from Foo::Baz without > knowing the > name of the module, but the only way i found is to call Foo.bar from > inside Baz. class Baz FooMod = Foo ... FooMod.bar end Now you only have to change it in one place at least --Apple-Mail-20--398169967--