Joel VanderWerf
3/9/2005 6:11:00 PM
Bertram Scharpf wrote:
> Hi,
>
> I want to understand thoroughly how singleton objects are
> implemented. I try this:
>
> class C ; end
>
> puts C.inspect # => C
> puts class <<C ; self ; end.inspect # => #<Class:C>
>
> Can someone give me a hint what's the difference between the
> both objects inspected? Thanks very much in advance.
The second object is the metaclass of C. There's a good explanation of
metaclasses in the PickAxe book.