Class: Ingreedy::DictionaryCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/ingreedy/dictionary_collection.rb

Instance Method Summary collapse

Constructor Details

#initializeDictionaryCollection

Returns a new instance of DictionaryCollection.



6
7
8
# File 'lib/ingreedy/dictionary_collection.rb', line 6

def initialize
  @collection = {}
end

Instance Method Details

#[]=(locale, attributes) ⇒ Object



10
11
12
# File 'lib/ingreedy/dictionary_collection.rb', line 10

def []=(locale, attributes)
  @collection[locale] = Dictionary.new(attributes)
end

#currentObject



14
15
16
# File 'lib/ingreedy/dictionary_collection.rb', line 14

def current
  @collection[locale] ||= Dictionary.new load_yaml(locale)
end