From: Jean-Hugues ROBERT Date: 2002-05-04T23:12:32+09:00 Subject: Re: Class methods defined in a module, how-to ? At 20:31 04/05/2002 +0900, you wrote: > >>>>> "J" == Jean-Hugues ROBERT writes: > >J> module MyModule >J> def self.foo() # not sure of what this does, but not what I want >J> print "foo" >J> end >J> end >J> class MyClass >J> include MyModule >J> end >J> MyClass.foo() # Does not work, foo is not defined for MyClass > > module MyModule > def foo() > print "foo" > end > end > class MyClass > extend MyModule > end > MyClass.foo() # work :-) > > >Guy Decoux Thanks. However I would like to *include* the module, not extending it. JHR ------------------------------------------------------------------------- Web: http://hdl.handle.net/1030.37/1.1 Phone: +33 (0) 4 92 27 74 17