class Mongoid::Matchable::And
Defines behavior for handling $or expressions in embedded documents.
Public Instance Methods
matches?(conditions)
click to toggle source
Does the supplied query match the attribute?
@example Does this match?
matcher.matches?([ { field => value } ])
@param [ Array ] conditions The or expression.
@return [ true, false ] True if matches, false if not.
@since 2.3.0
# 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