From: Daniel Berger Date: 2005-10-18T06:21:57+09:00 Subject: Re: declaratively caching results of a method Jeff Wood wrote: > if you look at the examples ... normally you include the Memoize > functionality in your class > > class Foo > include Memoize > > def calc1( *args ) > # do something here > end > > memoize :calc1 > end > > f = Foo.new > f.calc1( 1,2,3 ) > f.calc1( 1,2,3 ) > f.calc1( 7,8,9 ) This won't work: "undefined method `memoize' for Foo:Class (NoMethodError)" You could extend Memoize, and define a class method to memoize, I suppose. I'm also open to suggestions. Regards, Dan