This question already has an answer here:
Ruby metaclass confusion
I understand that every class in ruby is an instance of class “Class”. Even for Object, Kernel class.
However, I can not wrapper my head around how come Object class, which is an ancestor of class Class, can be an instance of class Class, which is it’s subclass.
irb(main):018:0* Class.ancestors => [Class, Module, Object, Kernel, BasicObject] irb(main):019:0> Object.ancestors => [Object, Kernel, BasicObject] irb(main):020:0> Object.class => Class