Method: PureValidator::ValidationErrors#empty?

Defined in:
lib/pure_validator/validation_errors.rb

#empty?Boolean Also known as: blank?

Returns true if no errors are found, false otherwise. If the error message is a string it can be empty.

errors.full_messages # => ["name can not be nil"]
errors.empty?        # => false

Returns:



143
144
145
# File 'lib/pure_validator/validation_errors.rb', line 143

def empty?
  messages.all? { |k, v| v && v.empty? && !v.is_a?(String) }
end