Class: Loader::JSON

Inherits:
Object
  • Object
show all
Defined in:
lib/iso3166_2/loader/json.rb

Overview

Knows how to load ISO3166-2 from a JSON file.

Class Method Summary collapse

Class Method Details

.load_iso_3166_2Object

Loads the ISO3166-2 standard from a CSV file.



7
8
9
10
11
# File 'lib/iso3166_2/loader/json.rb', line 7

def JSON.load_iso_3166_2
  json = File.new(File.expand_path('../../data/iso3166-2.json', __FILE__), 'r')
  parser = Yajl::Parser.new
  parser.parse(json)
end