Class: Pumi::DataSource::ISO31662
- Inherits:
-
Object
- Object
- Pumi::DataSource::ISO31662
- Defined in:
- lib/pumi/data_source/iso31662.rb
Instance Attribute Summary collapse
-
#data_file ⇒ Object
readonly
Returns the value of attribute data_file.
Instance Method Summary collapse
-
#initialize(data_file: Pumi::DataFile.new(:provinces)) ⇒ ISO31662
constructor
A new instance of ISO31662.
- #load_data!(output_dir: "data") ⇒ Object
Constructor Details
Instance Attribute Details
#data_file ⇒ Object (readonly)
Returns the value of attribute data_file.
4 5 6 |
# File 'lib/pumi/data_source/iso31662.rb', line 4 def data_file @data_file end |
Instance Method Details
#load_data!(output_dir: "data") ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/pumi/data_source/iso31662.rb', line 10 def load_data!(output_dir: "data") data.each do |code, attributes| attributes["iso3166_2"] = "KH-#{code.to_i}" end write_data!(output_dir) end |