Method: CSV::Table#==

Defined in:
lib/csv/table.rb

#==(other) ⇒ Object

:call-seq:

table == other_table -> true or false

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:

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:

other_table.delete(2)
table == other_table # => false

Different last row:

other_table << ['bat', 3]
table == other_table # => false


965
966
967
968
# File 'lib/csv/table.rb', line 965

def ==(other)
  return @table == other.table if other.is_a? CSV::Table
  @table == other
end