Sha256: fba6b1ad56aa0b126e6048aeddd218b185c55287bc25d609a5395b412108af73

Contents?: true

Size: 343 Bytes

Versions: 2

Compression:

Stored size: 343 Bytes

Contents

module MemoryModel::Base::Comparable

  def ==(other_object)
    attributes.slice(*fields.comparable) ==
      other_object.to_hash.with_indifferent_access.slice(*fields.comparable)
  end

  def !=(other_object)
    !(self == other_object)
  end

  def ===(other_object)
    other_object.kind_of?(self.class) && self == other_object
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
memory_model-0.0.2 lib/memory_model/base/comparable.rb
memory_model-0.0.1 lib/memory_model/base/comparable.rb