Module Locale::Util
In: lib/locale/util/memoizable.rb

Methods

clear   included   memoize  

Classes and Modules

Module Locale::Util::Memoizable

External Aliases

freeze -> freeze_without_memoizable

Public Class methods

Public Instance methods

Clear memoized values.

Cache the result of the methods.

 include Memoizable
 def foo
   ......
 end
 def bar(a, b)
   ......
 end
 memoize :foo, :bar(a, b)

To clear cache, clear_foo, clear_bar is also defined.

(NOTE) Consider to use this with huge objects to avoid memory leaks.

[Validate]