Sha256: 50dd999ff2f1badef153a894f6d89a4ab213f1f729e7a934bcf3a08dba95960d
Contents?: true
Size: 536 Bytes
Versions: 10
Compression:
Stored size: 536 Bytes
Contents
# encoding: utf-8 module Mongoid #:nodoc: module Matchers #:nodoc: # 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) Array.wrap(@attribute).any? { |e| value.values.first.include?(e) } end end end end
Version data entries
10 entries across 10 versions & 2 rubygems