Sha256: 382374001d74490059a927c3376edc5de91abb43f8189cb4406ae2e23dae84e5
Contents?: true
Size: 753 Bytes
Versions: 23
Compression:
Stored size: 753 Bytes
Contents
# encoding: utf-8 module Mongoid module Matchable # Defines behavior for handling $or expressions in embedded documents. class And < Default # 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 def matches?(conditions) conditions.each do |condition| condition.keys.each do |k| key = k value = condition[k] return false unless document.matches?(key => value) end end true end end end end
Version data entries
23 entries across 22 versions & 3 rubygems