Logan Capaldo
1/25/2006 4:57:00 AM
On Jan 24, 2006, at 11:28 PM, Vivek wrote:
> Hi,
> can someone explain this.
>
> irb(main):013:0> Class.instance_methods
> => ["superclass", "new"]
> irb(main):014:0> Class.class
> => Class
>
> I guess Class is an object(an instance of Class?) but its of type
> Class. How can an object's type be an object itself.?
>
> Vivek
>
>
In ruby, everything is an object. Even classes. Class inherits from
object just like everything else (well it inherits from Module which
inherits from Object). Its a little weird to get used to, but that's
how it works.