From: Christoph (news_chr) Date: 2003-10-02T14:05:13+09:00 Subject: Re: mixing in class methods "Nathaniel Talbott" wrote: .... > module M > def self.append_features(klass) > class << klass > def class_method > p "class_method" > end > end > super > end Actually the append_feature + super trick is somewhat outdated in 1.8.0 - use #included instead. --- module M end class << M module ClassMethods # this avoids name pollution def class_method1 p "class_method" end def class_method2 p "class_method2" end end def included(mod) if mod.is_a? Class mod.extend ClassMethods else # maybe raise an exception ? raise "bla ..." end end end class C include M end --- /Christoph