Yeah, it’s me again, your friendly neighbourhood power-suggester!
I’m wondering why there isn’t a
finalize' method classes can define, that will be called immediately before instances of that class are garbage collected? I'm aware of ObjectSpace.define_finalizer, but it seems un-OO, and it doesn't seem to work when being called from within the instance methods. It also seems as if the Proc sent todefine_finalizer’ isn’t called until after the object has been
# finalize something
A use case (the best I can come up with at the moment):
@filename = filename
def finalize save_as_xml(@filename) end