On Tue, Apr 11, 2006 at 02:46:24AM +0900, zdennis wrote:
> > Is there an easy way to extend classes with both class and object
> > methods at the same time?

>   irb(main):010:1*   def self.included( clazz )
>   irb(main):011:2>      clazz.extend( ClassLevelAddons )
>   irb(main):012:2>   end
>   irb(main):013:1> end
> 
> The above lets M take care of the work, so your class doesn't have to
> think about it. This is the method that Robert Klemme was refering to,
> Module::included

I was hoping that I was missing some clever way to do it with just one
module. Guess not. But the self.included hook is a good idea.  The two
modules become an implementation detail, and thats good enough.

Thanks,
Sam