George
11/26/2006 12:37:00 PM
On 11/25/06, Pat Maddox <pergesu@gmail.com> 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 "#<Class:Foo>" is #inspect-ese for "Foo's singleton class",
not "Foo"... ;-)
G.