From: Dave Bass Date: 2008-05-29T20:20:01+09:00 Subject: Re: subclass of hash, that times last read My approach would be quite different. I'd use files to store the values ("costly functions"), with the name of the file being determined by the key. (A sort of mini-database I suppose.) It's very easy to determine when a file was last accessed, so you could have a separate process running in the background looking for files to delete. When I did this, I used a cron job, but other approaches are possible of course. File accesses are going to be slower than hash lookups, but whether this is important or not depends on your application. And if some keys are used very frequently, the associated files should get cached in memory by the OS, so they should be quick to read. Of course you could wrap this in a class called MyHash. ;-) -- Posted via http://www.ruby-forum.com/.