Method: CSV::Table#<<
- Defined in:
- lib/csv.rb
#<<(row_or_array) ⇒ Object
Adds a new row to the bottom end of this table. You can provide an Array, which will be converted to a CSV::Row (inheriting the table’s headers()), or a CSV::Row.
This method returns the table for chaining.
775 776 777 778 779 780 781 782 783 |
# File 'lib/csv.rb', line 775 def <<(row_or_array) if row_or_array.is_a? Array # append Array @table << Row.new(headers, row_or_array) else # append Row @table << row_or_array end self # for chaining end |