Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

CSV::Table#to_csv

to_csv(write_headers: true, **options)

Returns the table as a complete CSV String. Headers will be listed first, then all of the field rows.

This method assumes you want the Table.headers(), unless you explicitly pass :write_headers => false.

See also #to_a #to_s #push #values_at also in 3.3 · 3.2 · 3.1