Method: I18n::Inflector::API_Strict#initialize

Defined in:
lib/i18n-inflector/api_strict.rb

#initialize(idb = nil, options = nil) ⇒ API_Strict

Note:

If any given option is nil then a proper object will be created. If it’s given, then it will be referenced, not copied.

Initilizes inflector by connecting to internal databases used for storing inflection data and options.

Parameters:

  • idb (Hash, nil) (defaults to: nil)

    the strict inflections databases indexed by locale

  • options (I18n::Inflector::InflectionOptions, nil) (defaults to: nil)

    the inflection options

[View source]

57
58
59
60
61
62
# File 'lib/i18n-inflector/api_strict.rb', line 57

def initialize(idb=nil, options=nil)
  @idb      = idb.nil?      ? {} : idb
  @options  = options.nil?  ? I18n::Inflector::InflectionOptions.new : options
  @lazy_locales = LazyHashEnumerator.for(@idb)
  @inflected_locales_cache = Hash.new
end