Class: I18n::JS::Private::ConfigStore Private
- Inherits:
-
Object
- Object
- I18n::JS::Private::ConfigStore
- Includes:
- Singleton
- Defined in:
- lib/i18n/js/private/config_store.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Caching implementation for I18n::JS.config
Instance Method Summary collapse
- #fetch ⇒ Object private
- #flush_cache ⇒ Object private
Instance Method Details
#fetch ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 18 19 20 21 22 23 |
# File 'lib/i18n/js/private/config_store.rb', line 15 def fetch return @config if @config yield.tap do |obj| raise ArgumentError, "unexpected falsy object from block" unless obj @config = obj end end |
#flush_cache ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 |
# File 'lib/i18n/js/private/config_store.rb', line 25 def flush_cache @config = nil end |