From: Gregory Seidman Date: 2006-06-12T05:31:01+09:00 Subject: Re: Why the lack of mixing-in support for Class methods? On Mon, Jun 12, 2006 at 05:14:20AM +0900, Daniel Schierbeck wrote: } Gregory Seidman wrote: } >... if you don't call class_methods before } >you first include the module (e.g. you want to reopen the module later to } >add class methods), the included method will fail since @class_methods is } >nil. } } Wouldn't this fix it? } } class Module } def class_methods(&block) } @class_methods ||= Module.new } @class_methods.module_eval(&block) } end } } def included(mod) } mod.extend(@class_methods ||= Module.new) } end } end } } I'm not saying this implementation is perfect; I only wrote it for this } thread. Sure, I understand. And yes, that would fix it. Take a look at the complete solution I posted at http://redcorundum.blogspot.com/2006/06/mixing-in-class-methods.html } Daniel --Greg