Method: Charty::VectorAdapters::BaseAdapter#==

Defined in:
lib/charty/vector_adapters.rb

#==(other) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/charty/vector_adapters.rb', line 39

def ==(other)
  case other.adapter
  when BaseAdapter
    return false if other.index != index
    if respond_to?(:compare_data_equality)
      compare_data_equality(other.adapter)
    elsif other.adapter.respond_to?(:compare_data_equality)
      other.adapter.compare_data_equality(self)
    else
      case other.adapter
      when self.class
        data == other.data
      else
        false
      end
    end
  else
    super
  end
end