From: Frank Tao Date: 2008-12-04T23:50:03+09:00 Subject: Re: dynamic programming Brian Candler wrote: > Frank Tao wrote: >> # I have a class Adam >> # I want to modify the method("m_a") so that it will return the cached >> result >> # If no cached result is available, then return the original result >> # I want to create a class method(AKA: macro) to make it DRY > > You might want to look at the 'memoize' method in ActiveRecord trunk. 'memoize'? Do you mean by the one in Rails 2.2 under ActiveSupport::Memoizable ? I also found Rails.cache or RAILS_CACHE in Rails 2.1 very helpful. -- Posted via http://www.ruby-forum.com/.