Sha256: 2e1859e0a2c33cf8ac39db7339b058fa5bb0cbeb3347fb27c63e5975f6de267b
Contents?: true
Size: 581 Bytes
Versions: 32
Compression:
Stored size: 581 Bytes
Contents
# encoding: utf-8 module Mongoid module Matchers # 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
32 entries across 32 versions & 2 rubygems