Exception: Ippon::Validate::ValidationError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/ippon/validate.rb

Overview

An exception class which is raised by Schema#validate! when a validation error occurs.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ ValidationError

Returns a new instance of ValidationError.


397
398
399
# File 'lib/ippon/validate.rb', line 397

def initialize(result)
  @result = result
end

Instance Attribute Details

#resultResult (readonly)

Returns the result object.

Returns:

  • (Result)

    the result object


395
396
397
# File 'lib/ippon/validate.rb', line 395

def result
  @result
end

Instance Method Details

#errorsArray<Error>

A shortcut for result.errors.

Returns:

  • (Array<Error>)

    the errors.


404
405
406
# File 'lib/ippon/validate.rb', line 404

def errors
  @result.errors
end