From: Hassan Schroeder Date: 2009-04-29T02:28:12+09:00 Subject: Re: Opposite of initialize On Tue, Apr 28, 2009 at 10:10 AM, Robert Klemme wrote: >>> I'm looking for the opposite function of initialize() as I need to >>> call something before an object is "destroyed". > And the finalizer is called *after* the object has gone! So "before" it's destroyed and "after" it's destroyed are two different things. ObjectSpace#finalizer wouldn't seem to fit the original request, if the OP is looking to actually *do* anything with the object (retrieve some attribute or whatever). Curious whether there's something else that would enable that case. -- Hassan Schroeder ------------------------ hassan.schroeder@gmail.com