From: Mark Volkmann Date: 2006-02-21T23:43:54+09:00 Subject: Re: "exporting" module methods On 2/21/06, Xavier Noria wrote: > Is there standard idiom to add module methods to classes that mixin > them? (Heh, is "mixin" also a verb in Ruby?) > > That is, I would like class C to croak: > > module M > def self.croak > puts "croak!" > end > end > > class C > include M > croak > end When you say you want class C to croak, I assume you really mean you'd like for objects from the class C to be able to croak. Remove the line "croak" from the class C definition and do this. c = C.new c.croak The rest of your code looks fine. -- R. Mark Volkmann Partner, Object Computing, Inc.