memoize.rb

Path: lib/active_support/vendor/i18n-0.4.1/i18n/backend/memoize.rb
Last Update: Fri Apr 05 21:24:42 +0000 2013

encoding: utf-8

Memoize module simply memoizes the values returned by lookup using a flat hash and can tremendously speed up the lookup process in a backend.

To enable it you can simply include the Memoize module to your backend:

  I18n::Backend::Simple.send(:include, I18n::Backend::Memoize)

Notice that it‘s the responsibility of the backend to define whenever the cache should be cleaned.

[Validate]