Class: Mongoid::Matchable::And
- Defined in:
- lib/mongoid/matchable/and.rb
Overview
Defines behavior for handling $or expressions in embedded documents.
Instance Attribute Summary
Attributes inherited from Default
Instance Method Summary collapse
-
#matches?(conditions) ⇒ true, false
Does the supplied query match the attribute?.
Methods inherited from Default
Constructor Details
This class inherits a constructor from Mongoid::Matchable::Default
Instance Method Details
#matches?(conditions) ⇒ true, false
Does the supplied query match the attribute?
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/mongoid/matchable/and.rb', line 18 def matches?(conditions) conditions.each do |condition| condition.keys.each do |k| key = k value = condition[k] return false unless Matchable.matcher(document, key, value).matches?(value) end end true end |