That's quite simple, it saves you some typing :) module A def a p 'a' endend A.a # doesn't work, because it is not written als def self.a - youhave to include the module in a class and initialize the class toaccess it. module A extend self def a p 'a' endend A.a# => 'a' voila, so now we can access the methods directly, otherwise you wouldhave to write module A def self.a p 'a' end def a p 'a' endend or similar... makes things a bit simpler - oh, and this is noscientific point of view of course, just wait for the multitude ofresponses that will explain it in detail ( i count on you guys :) On 5/27/06, Donald Luo <donaldluo / gmail.com> wrote:> I am a newbie to Ruby. I've found some code in the file dependencies.rb> within Active Support:>> module Dependencies> extend self> ...>> I would like to ask what does 'extend self' do here? What's purpose? I> didn't found any document mentioning such 'self-extension' case.>> Cheers,> Donald>> --> Posted via http://www.ruby-forum.com/.>>