Class: I18n::JS::Private::ConfigStore Private

Inherits:
Object
  • Object
show all
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

Instance Method Details

#fetchObject

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_cacheObject

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