From: Trans Date: 2006-08-23T00:30:04+09:00 Subject: Re: Yet another caching mechanism. The one without the cache. benjohn@fysh.org wrote: > > So I was looking at the differences with your implementation. What does > > the un_cahce do for us? > > It seemed to be an easy way to recover the original objects - ie, pull > them out of the caching decorator. Oh right, so you can use the same var name, eg. points. I see. the use of #uncache threw me beacuase I was thinking it did something more than just return the original object. With my implementation its just: points = points.collect{|point| point.self} I've found #self to be a pretty good public method to use for this in delegators, although prehaps it's a touch misleading, but it's short, to the point, and very unlikely to get in the way of method_missing. Hmmm... But I can also see how that might not always be the case, say if you are delgating another delegator, so myabe your class method approach is best? It's subtle. I'll just offer both options for unless someone can show how #self is really a bad idea. Thanks, T.