In Ruby, class methods are looked up in the singleton class of the receiver object.

class Child class << self def hello p 'hello' end end end

I understand how this works; it's fetched from Child 's singleton class.

p Child.singleton_class.instance_methods(false) >> [:hello]

But when we do inheritance such as in this case,

class Parent class << self def hello p 'hello' end end end class Child < Parent end

I don't understand how Child.hello works. The class Child is linked not to its singleton class, but is linked directly to Class object.

p Child.singleton_class.instance_methods(false) >> []

The Parent class is however linked to its singleton class, where hello is defined.

p Parent.singleton_class.instance_methods(false) >>[:hello]

But I don't understand how calling Child.hello would look up the method in the singleton class of Parent .

This is how I see the objects connected: