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_s

to_s(write_headers: true, **options)

Alias of #to_csv

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_csv #values_at #to_a also in 3.3 · 3.2 · 3.1