On Fri, Aug 29, 2008 at 10:16 PM, [email protected]
[email protected] wrote:
Mostly the " the class object Object"
Not sure if i can explain this well but i’ll take a shot at it.
Starting with the obvious, all objects have a class:
01> class X; end
More interestingly, this applies to classes themselves too:
In other words X is an instance of class.
Now, plain old objects are no different:
But Class itself is also an object (as David said, everything is an
–> [Class, Module, Object, PP::ObjectMixin, Kernel]
So, coming back to your original example:
07> Object === Object
This is true because the class of Object is Class and Class is a
descendent of Object.
The key here (methinks) is that you are asking whether the class of
Object is a descendent of Object.
Compare that to:
08> Object.new === Object
False because the class of an Object instance is Object and that
isn’t a descendent of Object.
Hope that didn’t confuse you further!