From: "Jacob Lauemøller" Date: 2010-07-06T17:43:27+09:00 Subject: [ruby-core:31072] Why is the inherited callback invoked at different times for static vs. dynamic subclasses? Hi all, Please consider this example: class A def self.inherited(subclass) puts "A was inherited by #{subclass}" end end class B < A puts "Definition of #{self}" end C = Class.new(A) do puts "Definition of #{self}" end When run, the output is A was inherited by B Definition of B Definition of # A was inherited by # So, the inherited callback was called *before* the class body in the "static" subclass B, but *after* the code in the block passed to Class.new for the dynamic subclass C. Is this a bug? My question is: why is this so? Shouldn't the two ways of creating subclasses be equivalent? Kind regards Jacob