Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

CSV::Row#==

row == other → true or false

Returns true if other is a /CSV::Row that has the same fields (headers and values) in the same order as self; otherwise returns false:

Example
source = "Name,Name,Name\nFoo,Bar,Baz\n"
table = CSV.parse(source, headers: true)
row = table[0]
other_row = table[0]
row == other_row # => true
other_row = table[1]
row == other_row # => false
See also #<< #[] .new #[]= also in 3.2 · 3.1 · 3.0