Method: CSV::Table#to_a
- Defined in:
- lib/csv/table.rb
#to_a ⇒ Object
Returns the table as an Array of Arrays. Headers will be the first row, then all of the field rows will follow.
353 354 355 356 357 358 359 360 |
# File 'lib/csv/table.rb', line 353 def to_a array = [headers] @table.each do |row| array.push(row.fields) unless row.header_row? end array end |