A = Class.new B = Class.new(A) C = Class.new(A) B.new C.new C.new ObjectSpace.each_object(B).count #=> 1 ObjectSpace.each_object(C).count #=> 2