class ObjectValidator::Checks::Presence
Public Instance Methods
call()
click to toggle source
# File lib/object_validator/checks/presence.rb, line 4 def call presence = !method.nil? || method.respond_to?(:empty?) && !method.empty? return if value == presence errors.add(name, 'must not be Nil') if value errors.add(name, 'must be Nil') unless value end