Skip to content

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

instance method

CSV::Table#inspect

table.inspect => string

Returns a US-ASCII-encoded String showing table:

  • Class: CSV::Table.

  • Access mode: :row, :col, or :col_or_row.

  • Size: Row count, including the header row.

Example:

Example
source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
table = CSV.parse(source, headers: true)
table.inspect # => "#<CSV::Table mode:col_or_row row_count:4>\nName,Value\nfoo,0\nbar,1\nbaz,2\n"
See also #headers #push #each #to_a also in 3.3 · 3.2 · 3.0