Class: Datasets::Wine
Defined Under Namespace
Classes: Record
Instance Attribute Summary
Attributes inherited from Dataset
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize ⇒ Wine
constructor
A new instance of Wine.
Methods inherited from Dataset
Constructor Details
#initialize ⇒ Wine
22 23 24 25 26 27 28 |
# File 'lib/datasets/wine.rb', line 22 def initialize super .id = 'wine' .name = 'Wine' .url = 'http://archive.ics.uci.edu/ml/datasets/wine' .description = -> { read_names } end |
Instance Method Details
#each ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/datasets/wine.rb', line 30 def each return to_enum(__method__) unless block_given? open_data do |csv| csv.each do |row| next if row[0].nil? record = Record.new(*row) yield(record) end end end |