Sha256: 06d21c4e89fd1e4a857049c62031eadab69a5a8d7ea103f511c3d14ba96f6753
Contents?: true
Size: 582 Bytes
Versions: 29
Compression:
Stored size: 582 Bytes
Contents
# encoding: utf-8 module Mongoid module Matchable # Checks for existence. 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
29 entries across 26 versions & 3 rubygems