Sha256: 1cfcad5042656b5d9e86d70fb3472f5b033930f56a5d103059a384d4a079bb20
Contents?: true
Size: 668 Bytes
Versions: 13
Compression:
Stored size: 668 Bytes
Contents
# frozen_string_literal: true # encoding: utf-8 module Mongoid module Matchable # Performs matching for any value in an array. class In < Default # Return true if the attribute is in the values. # # @example Do the values match? # matcher._matches?({ :key => 10 }) # # @param [ Hash ] value The values to check. # # @return [ true, false ] If a value exists. def _matches?(value) attribute_array = @attribute.nil? ? [nil] : Array.wrap(@attribute) value.values.first.any? do |e| attribute_array.any? { |_attribute| e === _attribute } end end end end end
Version data entries
13 entries across 13 versions & 2 rubygems