Exception: Square::ValidationException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/square/exceptions/validation_exception.rb

Overview

Class for exceptions when there is a schema validation error.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, template) ⇒ ValidationException

The constructor.

Parameters:

  • The (String)

    reason for raising an exception.



8
9
10
11
# File 'lib/square/exceptions/validation_exception.rb', line 8

def initialize(value, template)
  @reason = "The value #{value} provided doesn't validate against the schema #{template}"
  super(reason)
end

Instance Attribute Details

#reasonObject (readonly)

Returns the value of attribute reason.



4
5
6
# File 'lib/square/exceptions/validation_exception.rb', line 4

def reason
  @reason
end