From: Eleanor McHugh Date: 2009-04-29T01:55:53+09:00 Subject: Re: Opposite of initialize On 28 Apr 2009, at 17:45, peter.meier998@gmail.com wrote: > I'm looking for the opposite function of initialize() as I need to > call something before an object is "destroyed". ObjectSpace#define_finalizer allows you to have a proc executed when an object is about to be destroyed. If I remember rightly this is when the object is actually garbage collected, which can be some time after all its references have been released. Ellie Eleanor McHugh Games With Brains http://slides.games-with-brains.net ---- raise ArgumentError unless @reality.responds_to? :reason