From: George Ogata Date: 2006-11-26T21:36:45+09:00 Subject: Re: Calling methods from within singleton class On 11/25/06, Pat Maddox wrote: > > class << Foo > def foo > "foo" > end > end This defines a `foo' method on instances of Foo's singleton class, namely Foo. > class << Foo > foo > end > > ... NameError ... This calls `foo' on Foo's singleton class, not Foo. Note that "#" is #inspect-ese for "Foo's singleton class", not "Foo"... ;-) G.