From: Daniel Schierbeck Date: 2006-06-13T01:37:46+09:00 Subject: Re: Why the lack of mixing-in support for Class methods? Gregory Seidman wrote: > On Mon, Jun 12, 2006 at 07:19:10PM +0900, Daniel Schierbeck wrote: > } class Module > } def meta_module(&block) > } @meta_module ||= Module.new > } @meta_module.module_eval(&block) > } extend(@meta_module) > > Why should the module extend the meta_module? Because I'd like the meta-module methods to act as module methods -- if you don't like that, remove that line. > } end > } > } def included(mod) > } mod.extend(@meta_module ||= Module.new) > > Again, if it's a module why should it extend the meta_module? > > } if mod.kind_of? Module > > This definitely won't work. You need to check for Class, not Module. Check > it out: > > % irb > irb(main):001:0> Object.kind_of? Module > => true Or `instance_of? Module' Again, I haven't had time to fully test this implementation -- please focus on the interface. Cheers, Daniel