This is mostly an “academic” one but here it goes:
According to this Ruby eigenclass diagram (slightly edited):
BasicObject.singleton_class.singleton_class.superclass is Class.
However, running this on a Ruby interpreter (Ruby v2.5.1), it turns out that BasicObject.singleton_class.singleton_class.superclass is #<Class:Class> and not Class. Therefore, is the diagram lying or am I missing something?
The diagram is from a user I chatted with at Ruby IRC in Freenode. However, it's been quoted multiple times to many other users and it's been treated as the Ruby object model bible.

The behavior of the Ruby interpreter makes perfect sense because:
Childclass extends aParent, Ruby sets it up so that the singleton class#<Class:Child>extends#<Class:Parent>as well; andBasicObject.singleton_classis a subclass ofClass, soBasicObject.singleton_class.singleton_classwill be a subclass of#<Class:Class>Verifying the equality:
This leads to the next question – why does
#<Class:BaseObject>extendClassin the first place? Following the rule above, sinceBaseObjecthas no superclass – that is,BaseObject.superclassisnil– the logical thing would be for its singleton class to not have a superclass either.The answer is that
#<Class:BaseObject>extendingClassensures consistency in the inheritance hierarchy when it comes to singleton classes. Take this Ruby object for example:It is a well-established notion that instead of
objbeing simply an instance ofString, we can think of it as an (only) instance of its own singleton class, which in turn is a subclass ofString. That is:It seems only logical that the same should apply to class instances as well. But it does not, because it contradicts the rule mentioned above, where the superclass of a singleton class of a
Childclass is the singleton class of itsParentclass.But it is possible to resolve this contradiction by placing
Classat the top of the singleton class inheritance hierarchy:This way, even though
Foo.singleton_class.superclassis not equal toFoo.class, by walking up the inheritance chain, it does get there eventually...