Module: MongoODM::Document::Equality::InstanceMethods

Defined in:
lib/mongo_odm/document/equality.rb

Instance Method Summary collapse

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==

Returns:



9
10
11
# File 'lib/mongo_odm/document/equality.rb', line 9

def eql?(other)
  other.is_a?(self.class) && _id == other._id && attributes == other.attributes
end

#hashObject



14
15
16
# File 'lib/mongo_odm/document/equality.rb', line 14

def hash
  _id.hash
end