Class: ImportEverything::DisplayTable
- Includes:
- FromHash
- Defined in:
- lib/import_everything/preview.rb
Instance Attribute Summary collapse
-
#rows ⇒ Object
Returns the value of attribute rows.
-
#table ⇒ Object
Returns the value of attribute table.
Instance Method Summary collapse
Instance Attribute Details
#rows ⇒ Object
Returns the value of attribute rows.
3 4 5 |
# File 'lib/import_everything/preview.rb', line 3 def rows @rows end |
#table ⇒ Object
Returns the value of attribute table.
3 4 5 |
# File 'lib/import_everything/preview.rb', line 3 def table @table end |
Instance Method Details
#each_row_value_array ⇒ Object
8 9 10 11 12 13 |
# File 'lib/import_everything/preview.rb', line 8 def each_row_value_array rows.each do |row| vals = keys.map { |k| row[k] } vals.each { |x| yield(x) } end end |
#row_value_arrays ⇒ Object
14 15 16 17 18 |
# File 'lib/import_everything/preview.rb', line 14 def row_value_arrays rows.map do |row| keys.map { |k| row[k] } end end |
#to_hash ⇒ Object
22 23 24 |
# File 'lib/import_everything/preview.rb', line 22 def to_hash {:keys => keys, :row_arrays => row_value_arrays, :table => table} end |