Sha256: cd30c453c3d81ab64a3eb79ba38a4ac1523ebb8e96aefae0da56d00e29dc09c9
Contents?: true
Size: 578 Bytes
Versions: 42
Compression:
Stored size: 578 Bytes
Contents
# encoding: utf-8 module Mongoid module Matchable # Performs not in checking. class Nin < Default # Return true if the attribute is not in the value list. # # @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) attribute_array.none? { |e| value.values.first.include?(e) } end end end end
Version data entries
42 entries across 38 versions & 3 rubygems