Class: Mongoid::Matchable::Eq

Inherits:
Default
  • Object
show all
Defined in:
build/mongoid-7.0/lib/mongoid/matchable/eq.rb

Overview

Performs equivalency checks.

Since:

  • 4.0.0

Instance Attribute Summary

Attributes inherited from Default

#attribute, #document

Instance Method Summary collapse

Methods inherited from Default

#initialize

Constructor Details

This class inherits a constructor from Mongoid::Matchable::Default

Instance Method Details

#_matches?(value) ⇒ true, false

Return true if the attribute and first value are equal.

Examples:

Do the values match?

matcher._matches?({ :key => 10 })

Parameters:

  • value (Hash)

    The values to check.

Returns:

  • (true, false)

    True if matches, false if not.

Since:

  • 4.0.0



17
18
19
# File 'build/mongoid-7.0/lib/mongoid/matchable/eq.rb', line 17

def _matches?(value)
  super(value.values.first)
end