From: Max Lapshin Date: 2006-10-10T13:55:56+09:00 Subject: Re: "def self.method" vs "class << self; def method" On Oct 10, 2006, at 3:55 AM, joevandyk@gmail.com wrote: > What's the difference between > > class Foo > class << self > def foo; end > end > end Such definition evals area of code in scope of object self, referenced to constant Foo and adds singleton methods to it. > class Foo > def self.foo; end > end Such definition creates a singleton method on object self, which is equal to constant Foo in this scope.