From: Sam Roberts Date: 2006-04-11T02:20:43+09:00 Subject: Re: Adding both class and instance/object methods from a Module? On Mon, Apr 10, 2006 at 08:57:04PM +0900, Robert Klemme wrote: > There's an easier way: > > class D > extend M > end > > or > > class D;end > D.extend M Is there an easy way to extend classes with both class and object methods at the same time? module M def self.create # would do something special here new end def objmethod end end class A extend M end a.create # <-- nope, doesn't work I sometimes have a number of classes that I want to share implementation, but that don't have an "isa" relationship. Modules are great for this, but when that implementation includes both object and class methods, I'm not sure what to do. Sam