From: Gavin Sinclair Date: 2003-10-02T07:37:25+09:00 Subject: Re: mixing in class methods On Thursday, October 2, 2003, 7:08:00 AM, Ryan wrote: > On Thu, 2 Oct 2003 06:02:32 +0900 > "Mark J. Reed" wrote: >> Okay, probably a dumb question, but: is there any way to define >> methods in a module which become class methods of any class which >> includes that module? > Close: > module M > def foo > p "Hello world" > end > end > class C > end > class << C > include M > end > C.foo # => "Hello world" Alternatively, class C extend M end C.foo # => "Hello world" Gavin