Sha256: e8338be191f97851b89a302835ece2160f93f134a67d18433db6b9db55bc52c8
Contents?: true
Size: 582 Bytes
Versions: 17
Compression:
Stored size: 582 Bytes
Contents
# encoding: utf-8 module Mongoid module Matchable # 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
17 entries across 17 versions & 5 rubygems