Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
CSV::Table#==
table == other_table → true or false
lib/csv/table.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/csv/table.rb, line 965
def ==(other)
return @table == other.table if other.is_a? CSV::Table
@table == other
end
Returns true if all each row of self == the corresponding row of other_table, otherwise, false.
The access mode does no affect the result.
Equal tables:
Example
source = "Name,Value\nfoo,0\nbar,1\nbaz,2\n" table = CSV.parse(source, headers: true) other_table = CSV.parse(source, headers: true) table == other_table # => true
Different row count:
Example
other_table.delete(2) table == other_table # => false
Different last row:
Example
other_table << ['bat', 3] table == other_table # => false