Not immediately, I guess, as Ruby uses mark-and-sweep gc instead of
reference counting.  If you can wait, and write Ruby in C, you can just
put the "destructor" in the corresponding free() function.

Regards,

Bill
==================================================================
Stathy G. Touloumis <stathy.touloumis / edisonaffiliates.com> wrote:
> Is there a way to invoke a method when references to an object have gone 
> out of scope?