From: Steve Tuckner Date: 2001-05-18T01:17:35+09:00 Subject: [ruby-talk:15332] Newbie Module Mixin Issue 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). Module ObjectDB alias :new :oldnew def new $ObjectList.push(self) oldnew end end class A include ObjectDB def initialize print "In A initialize\n" end end a = A.new a1 = A.new # $ObjectList contains [a, a1]