>>>>> "R" == Ralph Mason <ralph.mason / telogis.com> writes:

R> Does class << self is creating an unnamed subclass?

 In this case, no. In ruby a class is an object like any other objects,
 this mean that it has a class, it's called the metaclass.

 When you create a class, ruby automatically create its metaclass. In this
 example

    class << self

 make reference to the metaclass

 For an object :
    * instance variable are stored in the object (this is why each object
      has its own instance)
    * method are stored in the class

 This is the same for a class
    * class instance variable are stored in the class 
    * class methods are stored in the class of the class, i.e. the
      metaclass 

 In my example
    @foo, @bar are in the class
    Foo::foo, Foo::bar are in the metaclass


Guy Decoux