From: Christoph Date: 2002-04-28T09:01:26+09:00 Subject: Re: def self.foo in a module "Mark Volkmann" wrote in .... > What is the purpose of "self." below? > > module Foo > def self.bar() > # some code goes here > end > end > module Foo p self # => Foo # in other words # def self.bar() # # some code goes here # end # is equivalent to def Foo.bar ... # same code goes here end end # or up to scope def Foo.bar # same code goes here end # The lattter defines a singleton method for the Module # object Foo and can be called as Foo.bar /Christoph