From: Gennady Date: 2003-08-12T07:24:35+09:00 Subject: Re: newbie mixin questions ----- Original Message ----- From: "Michael Garriss" To: "ruby-talk ML" Sent: Monday, August 11, 2003 3:16 PM Subject: newbie mixin questions > Hi, > Just 2 questions: > > 1) How can I mixin a class method (not an instance method)? class A class << self include SomeModule end end > > 2) How can I force a certain method to be called when the an object of a > class that includes that module is initialized? Sort of like a mixin > initialize.... module SomeModule def new(*args) object = super *args # call whatever you want here object end end > > TIA > Michael Garriss > > >