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
lib/csv/table.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/csv/table.rb, line 1049
def inspect
inspected = +"#<#{self.class} mode:#{@mode} row_count:#{to_a.size}>"
summary = to_csv(limit: 5)
inspected << "\n" << summary if summary.encoding.ascii_compatible?
inspected
end
Returns a US-ASCII-encoded String showing table:
-
Class:
CSV::Table. -
Access mode:
:row,:col, or:col_or_row. -
Size:
Rowcount, 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"