From: Steve Tuckner Date: 2002-07-04T03:35:20+09:00 Subject: RE: Mixin class methods Try "extend" (see below): ---------------------------------- module A def b(x) print x, "\n" end end class Foo extend A end Foo.b(3) ==> "3" ---------------------------------- Steve Tuckner -----Original Message----- From: Philipp Meier [mailto:meier@meisterbohne.de] Sent: Wednesday, July 03, 2002 1:26 PM To: ruby-talk@ruby-lang.org Subject: Mixin class methods Hello all, I have another question regarding Mixins. How can I mix in class methods? I'd like the folling to work: module Foo def Foo.foo # this doesn't work return "foo" end end class Bar include Foo end Bar.foo # -> NameError: undefined method `foo' for Bar:Class Any help is appreciated! -billy. -- Meisterbohne S�flinger Stra�e 100 Tel: +49-731-399 499-0 eL�sungen 89077 Ulm Fax: +49-731-399 499-9