Module: Locale::Util

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

### Methods

included memoize memoize_clear memoize_dup

### Classes and Modules

Module Locale::Util::Memoizable

### External Aliases

freeze | -> | freeze_without_memoizable

### Public Class methods

included(base)

### Public Instance methods

memoize(*symbols)

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.
- Can‘t use this with super.<method> because of infinity loop.

memoize_clear()

Clear memoized values.

memoize_dup(*symbols)

memoize with dup. A copy object is returned.

[Validate]