From: Joel VanderWerf Date: 2004-09-10T04:55:49+09:00 Subject: Re: Problem with ensuring consistency .. Finalization?? Charles Hixson wrote: > Austin Ziegler wrote: ... >> Perhaps an END {} block? >> >> -austin >> >> > That looks like a good approach (well, the best suggested). I'd rather > have it tied into the class, so that the class could be moved from > application to application, but if I can't, I can't. Having it a part > of the containing file is certainly a "next best" viable approach. > > (I didn't even remember that END blocks existed, though I know I've read > that page before!) IIRC, Kernel#at_exit has the same functionality, but you can call it from a method in your class. class C def foo at_exit do puts "Done!" end end end