> On Thu, Oct 02, 2003 at 07:37:25AM +0900, Gavin Sinclair wrote: >> On Thursday, October 2, 2003, 7:08:00 AM, Ryan wrote: >> >> > class << C >> > include M >> > end >> >> Alternatively, >> >> class C >> extend M >> end > > Okay, those both work, assuming all I want is class methods from the > module. I'm guessing I have to break it up. The original idea was to > have a single module, which defined both class and instance methods, > which I could include/extend/whatever into a class, and then that class > would have both the instance methods (as instance methods) and the class > methods (as class methods) from the module. > > -Mark Yes, it's too much to ask :) Ruby doesn't know the difference between instance and class methods. Every method is an instance method, it's just that some instances happen to be classes. Note that "C.extend(M)" works as well, just like "(s = '').extend(M)". It sometimes makes me wonder why Ruby differentiates between instance variables and class variables. The latter seem exceptional, for a number of reasons. Gavin