Sha256: 4ae746761005c42b329a1beda9fb43dc07b1dc0684a56f674522dd60914d101e
Contents?: true
Size: 615 Bytes
Versions: 13
Compression:
Stored size: 615 Bytes
Contents
# frozen_string_literal: true # 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
13 entries across 13 versions & 2 rubygems