Class: Ingreedy::DictionaryCollection
- Inherits:
-
Object
- Object
- Ingreedy::DictionaryCollection
- Defined in:
- lib/ingreedy/dictionary_collection.rb
Instance Method Summary collapse
- #[]=(locale, attributes) ⇒ Object
- #current ⇒ Object
-
#initialize ⇒ DictionaryCollection
constructor
A new instance of DictionaryCollection.
Constructor Details
#initialize ⇒ DictionaryCollection
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 |
#current ⇒ Object
14 15 16 |
# File 'lib/ingreedy/dictionary_collection.rb', line 14 def current @collection[locale] ||= Dictionary.new load_yaml(locale) end |