Class: Datasets::Geolonia
Defined Under Namespace
Classes: Record
Instance Attribute Summary
Attributes inherited from Dataset
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize ⇒ Geolonia
constructor
A new instance of Geolonia.
Methods inherited from Dataset
Constructor Details
#initialize ⇒ Geolonia
Returns a new instance of Geolonia.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/datasets/geolonia.rb', line 22 def initialize super .id = 'geolonia' .name = 'Geolonia' .url = 'https://github.com/geolonia/japanese-addresses' .licenses = ["CC-BY-4.0"] .description = lambda do fetch_readme end end |
Instance Method Details
#each ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/datasets/geolonia.rb', line 33 def each return to_enum(__method__) unless block_given? open_data do |csv| csv.readline csv.each do |row| record = Record.new(*row) yield(record) end end end |