Class: Forgery::Dictionaries
- Inherits:
-
Object
- Object
- Forgery::Dictionaries
- Defined in:
- lib/forgery/dictionaries.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize ⇒ Dictionaries
constructor
A new instance of Dictionaries.
- #loaded?(key) ⇒ Boolean
- #reset! ⇒ Object
Constructor Details
#initialize ⇒ Dictionaries
Returns a new instance of Dictionaries.
5 6 7 |
# File 'lib/forgery/dictionaries.rb', line 5 def initialize @dictionaries = {} end |
Instance Method Details
#[](key) ⇒ Object
9 10 11 12 |
# File 'lib/forgery/dictionaries.rb', line 9 def [](key) symbolized_key = key.to_sym @dictionaries[symbolized_key] ||= Forgery::Extend(FileReader.read_dictionary(symbolized_key)) end |
#loaded?(key) ⇒ Boolean
14 15 16 |
# File 'lib/forgery/dictionaries.rb', line 14 def loaded?(key) @dictionaries.has_key?(key.to_sym) end |
#reset! ⇒ Object
18 19 20 |
# File 'lib/forgery/dictionaries.rb', line 18 def reset! @dictionaries = {} end |