Sha256: de8c11e6141bc475844ca6ae950222abe1a7126fe9064d7e835b564a9e34f858
Contents?: true
Size: 599 Bytes
Versions: 188
Compression:
Stored size: 599 Bytes
Contents
# encoding: utf-8 module Mongoid #:nodoc: module Matchers #:nodoc: # Checks for existance. class Exists < Default # Return true if the attribute exists and checking for existence or # return true if the attribute does not exist and checking for # non-existence. # # @example Does anything exist? # matcher.matches?({ :key => 10 }) # # @param [ Hash ] value The values to check. # # @return [ true, false ] If a value exists. def matches?(value) @attribute.nil? != value.values.first end end end end
Version data entries
188 entries across 96 versions & 4 rubygems