Module: MongoMapper::Plugins::Equality::InstanceMethods

Defined in:
lib/novelys_mongo_mapper/plugins/equality.rb

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object



5
6
7
# File 'lib/novelys_mongo_mapper/plugins/equality.rb', line 5

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

#eql?(other) ⇒ Boolean

Returns:



9
10
11
# File 'lib/novelys_mongo_mapper/plugins/equality.rb', line 9

def eql?(other)
  self == other
end

#equal?(other) ⇒ Boolean

Returns:



13
14
15
# File 'lib/novelys_mongo_mapper/plugins/equality.rb', line 13

def equal?(other)
  object_id === other.object_id
end

#hashObject



17
18
19
# File 'lib/novelys_mongo_mapper/plugins/equality.rb', line 17

def hash
  _id.hash
end