From: Christoph (news_chr) Date: 2003-12-14T20:22:00+09:00 Subject: Re: append_features(mod) -- mod.kind_of? makes absolutely no sense "T. Onoma" wrote in message news:200312132339.37352.transami@runbox.com... > First of all, if class Class inherits class Module then why isn't > append_features defined for Class? > > class Whatever > append_features MyModule > end > # => undefined method `append_features' for Whatever:Class (NoMethodError) Isn't this the whole point of Module#undef (or undef_method)? class A def foo end end class B < A undef :foo end B.new.foo # undefined method `foo' ... .... > Its my understanding the include passes each Module to append_features, but > that's not what append_features is saying. In fact, according to this > append_features is appending Test to Test, even though it works fine. Please, > tell me I'm over looking the obvious here. Don't worry, you are overlooking the obvious:-) class Module alias append_features_orig append_features def append_features(mod) # changed from p mod, mod.class p mod, self append_features_orig(mod) end end module MyModule def wow puts "You have to be kidding!" end end class Test include MyModule end t = Test.new t.wow /Christoph