Class: CompanyNumber::Dictionary

Inherits:
Object
  • Object
show all
Defined in:
lib/company_number/dictionary.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(country_codes_metadata = {}) ⇒ Dictionary

Returns a new instance of Dictionary.



11
12
13
14
15
16
# File 'lib/company_number/dictionary.rb', line 11

def initialize( = {})
  @country_codes_metadata = 
  @default_hash           = load_default_hash

  
end

Instance Attribute Details

#country_codes_metadataObject (readonly)

Returns the value of attribute country_codes_metadata.



5
6
7
# File 'lib/company_number/dictionary.rb', line 5

def 
  @country_codes_metadata
end

#default_hashObject (readonly)

Returns the value of attribute default_hash.



5
6
7
# File 'lib/company_number/dictionary.rb', line 5

def default_hash
  @default_hash
end

Class Method Details

.default_dictionary_pathObject



7
8
9
# File 'lib/company_number/dictionary.rb', line 7

def self.default_dictionary_path
  File.join(File.dirname(__FILE__), "../../config/dictionary.json")
end

Instance Method Details

#valuesObject



18
19
20
# File 'lib/company_number/dictionary.rb', line 18

def values
  @_values ||= fetch_values
end