Class: Loader::JSON
- Inherits:
-
Object
- Object
- Loader::JSON
- Defined in:
- lib/iso3166_2/loader/json.rb
Overview
Knows how to load ISO3166-2 from a JSON file.
Class Method Summary collapse
-
.load_iso_3166_2 ⇒ Object
Loads the ISO3166-2 standard from a CSV file.
Class Method Details
.load_iso_3166_2 ⇒ Object
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.('../../data/iso3166-2.json', __FILE__), 'r') parser = Yajl::Parser.new parser.parse(json) end |