From: Steve Tuckner Date: 2001-05-19T03:45:00+09:00 Subject: [ruby-talk:15376] Re: Newbie Module Mixin Issue Thanks for the tip. That worked however, each class that has this mixed in, must call super in its initialize function even though the class has no "real" superclass. I don't suppose there is any way around that? Steve Tuckner -----Original Message----- From: Mathieu Bouchard [mailto:matju@sympatico.ca] Sent: Thursday, May 17, 2001 4:34 PM To: ruby-talk@ruby-lang.org; Steve Tuckner Cc: ruby-talk ML Subject: [ruby-talk:15345] Re: Newbie Module Mixin Issue On Fri, 18 May 2001, Steve Tuckner wrote: > I want to write a module that when mixed into another class finds out when a > new object of that class or sub-class is created. I thought of aliasing the > new method or some other such way but I don't know enough ruby to get his > done. Below is what I am thinking (this obviously doesn't work). Just a tip: don't mess with "new" unless you really know what you're doing. $object_list = [] module ObjectDB # *args is for "accept anything" def initialize(*args) $object_list.push self super end end matju