From: Jamis Buck Date: 2004-11-11T04:56:47+09:00 Subject: Re: hook for class creation Florian Gross wrote: > itsme213 wrote: > >> Is there a hook method called whenever a new class is created i.e. >> guaranteed called for every new instance of Class ? > > > You can try Object.inherited, but I'm not sure if it will get called > when a class is created internally in C code. > > Plus it can be overridden in subclasses so there is no 100% guarantee of > it getting called. > > . > What about just putting the initialization code in the class definition? class Foo def bar ... end ... # class init do_something do_something_else end - Jamis -- Jamis Buck jgb3@email.byu.edu http://www.jamisbuck.org/jamis