Skip to content

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

instance method

CSV::Row#inspect

row.inspect → string

Returns an ASCII-compatible String showing:

  • Class CSV::Row.

  • Header-value pairs.

Example:

Example
source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n"
table = CSV.parse(source, headers: true)
row = table[0]
row.inspect # => "#<CSV::Row \"Name\":\"foo\" \"Value\":\"0\">"
See also #initialize_copy #key? #index #member? also in 3.3 · 3.1 · 3.0