module Mongoid::Equality
def <=>(other)
-
(Integer)- -1, 0, 1.
Parameters:
-
other(Document) -- The document to compare with.
Other tags:
- Example: Compare two documents. -
def <=>(other) attributes["_id"].to_s <=> other.attributes["_id"].to_s end
def ==(other)
-
(true | false)- True if the ids are equal, false if not.
Parameters:
-
other(Document | Object) -- The other object to compare with.
Other tags:
- Example: Compare for equality. -
def ==(other) self.class == other.class && attributes["_id"] == other.attributes["_id"] end
def ===(other)
-
(true | false)- True if the classes are equal, false if not.
Parameters:
-
other(Document | Object) -- The other object to compare with.
Other tags:
- Example: Compare the classes. -
def ===(other) if Mongoid.legacy_triple_equals other.class == Class ? self.class === other : self == other else super end end
def eql?(other)
-
(true | false)- True if equal, false if not.
Parameters:
-
other(Document | Object) -- The object to check against.
Other tags:
- Example: Perform equality checking. -
def eql?(other) self == (other) end