Class: Datasets::HouseOfRepresentative
- Defined in:
- lib/datasets/house-of-representative.rb
Defined Under Namespace
Classes: Record
Instance Attribute Summary
Attributes inherited from Dataset
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize ⇒ HouseOfRepresentative
constructor
A new instance of HouseOfRepresentative.
Methods inherited from Dataset
Constructor Details
#initialize ⇒ HouseOfRepresentative
Returns a new instance of HouseOfRepresentative.
48 49 50 51 52 53 54 55 56 |
# File 'lib/datasets/house-of-representative.rb', line 48 def initialize super() .id = "house-of-representative" .name = "Bill of the House of Representatives of Japan" .url = "https://smartnews-smri.github.io/house-of-representatives" .licenses = ["MIT"] .description = "Bill of the House of Representatives of Japan" end |
Instance Method Details
#each ⇒ Object
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/datasets/house-of-representative.rb', line 58 def each return to_enum(__method__) unless block_given? open_data do |csv| csv.each do |row| record = Record.new(*row.fields) yield(record) end end end |