"Trans" <transfire / gmail.com> writes:

>   def x
>     return_on @cache[:x]
>     # do stuff
>     @cache[:x] = result_of_stuff
>   end

def x
  @cache.fetch(:x) {
    @cache[:x] = result_of_stuff
  }
end

-- 
Christian Neukirchen  <chneukirchen / gmail.com>  http://chneukirchen.org