Method: Mongoid::Criteria::Queryable::Key#==

Defined in:
lib/mongoid/criteria/queryable/key.rb

#==(other) ⇒ true | false Also known as: eql?

Does the key equal another object?

Examples:

Is the key equal to another?

key == other
key.eql? other

Parameters:

  • other (Object)

    The object to compare to.

Returns:

  • (true | false)

    If the objects are equal.



87
88
89
90
# File 'lib/mongoid/criteria/queryable/key.rb', line 87

def ==(other)
  return false unless other.is_a?(Key)
  name == other.name && operator == other.operator && expanded == other.expanded
end