Class: Forgery::Dictionaries

Inherits:
Object
  • Object
show all
Defined in:
lib/forgery/dictionaries.rb

Instance Method Summary (collapse)

Constructor Details

- (Dictionaries) initialize



5
6
7
# File 'lib/forgery/dictionaries.rb', line 5

def initialize
  @dictionaries = {}
end

Instance Method Details

- (Object) [](key)



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

- (Boolean) loaded?(key)



14
15
16
# File 'lib/forgery/dictionaries.rb', line 14

def loaded?(key)
  @dictionaries.has_key?(key.to_sym)
end

- (Object) reset!



18
19
20
# File 'lib/forgery/dictionaries.rb', line 18

def reset!
  @dictionaries = {}
end