lib/company_number/dictionary.rb in company_number-0.1.3 vs lib/company_number/dictionary.rb in company_number-0.1.4

- old
+ new

@@ -3,11 +3,11 @@ module CompanyNumber class Dictionary attr_reader :country_codes_metadata, :default_hash def self.default_dictionary_path - File.join(File.dirname(__FILE__), "../../config/dictionary.yml") + File.join(File.dirname(__FILE__), "../../config/dictionary.json") end def initialize(country_codes_metadata = {}) @country_codes_metadata = country_codes_metadata @default_hash = load_default_hash @@ -31,10 +31,10 @@ CompanyNumber.configuration.excluded_countries.include?(country_code) end end def load_default_hash - YAML.safe_load( + JSON.parse( File.read(self.class.default_dictionary_path), symbolize_names: true ) end