From: Daniel Schierbeck Date: 2006-06-16T19:46:24+09:00 Subject: Re: Why the lack of mixing-in support for Class methods? Yukihiro Matsumoto wrote: > module M > class_extension do > def foo > end > end > end > module M2 > include M > end > class C > include M2 > end > > M.foo # => NoMethodError > M2.foo # => Error? (should it affect modules?) No, the class extension should be included into both modules and classes. I think this'll get too complex otherwise, with users wondering why #include works differently in classes and modules. > C.foo # => Error? (should class_extension be propagated?) I'm not sure on that one, though I'd default to say yes, it should be propagated. > If 'class_extension' affects modules as well, do you think of any > more generic name, in place of "class" extension? I temporarily used #metamodule or something similar, as I saw the class extension as a "module above the module", that got included into the "class above the class". That may be rubbish, but it's how I think of it. Cheers, Daniel