Method: CSV::Table#to_a

Defined in:
lib/csv.rb

#to_aObject

Returns the table as an Array of Arrays. Headers will be the first row, then all of the field rows will follow.



862
863
864
865
866
867
868
869
870
# File 'lib/csv.rb', line 862

def to_a
  @table.inject([headers]) do |array, row|
    if row.header_row?
      array
    else
      array + [row.fields]
    end
  end
end