This happens b/c Object
is a superclass of Class
itself. So class Object
is an instance of Object
(confusing). When you define an instance method on Dog
you dont cause the same issue b/c the class Dog
does not appear in the inheritance chain of Class
Object.instance_of?(Class) # True
Class.is_a?(Object) # True
Class.is_a?(Dog) # False