class Mongoid::Matchable::Nin

Performs not in checking.

Public Instance Methods

_matches?(value) click to toggle source

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.

# File lib/mongoid/matchable/nin.rb, line 18
def _matches?(value)
  attribute_array = @attribute.nil? ? [nil] : Array.wrap(@attribute)
  attribute_array.none? { |e| value.values.first.include?(e) }
end