From: Christoffer Sawicki Date: 2006-05-20T00:34:43+09:00 Subject: Re: Mixing-in the inherited method Hello Joel, > A is not a subclass of Class, it's an instance of Class. Indeed. > Also, you need to use extend rather than include, so that the instance > methods of Foobar (particularly, #inherited) become methods of A. > Otherwise, the instance methods of Foobar become instance methods of > _instances_ of A. > > These two examples both print "A": > > /.../ I understand your examples and your argument, but you seem to be missing my point (if I have one). Instance methods of class Class become class methods of Class instances, so why doesn't the mixed-in inherited() work? Comparing these two examples, why is the output of the second different? = Example 1 class Class def inherited(klass) p klass end def test! p "test!" end end class A; end A.test! == Output A "test!" = Example 2 module Foo def inherited(klass) p klass end def test! p "test!" end end class Class include Foo end class A; end A.test! == Output "test!" Thanks, -- Christoffer Sawicki