Exception: Natsuzora::Contract::ValidationError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/natsuzora/contract/validator.rb

Overview

Error that can occur during validation.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, path = '$') ⇒ ValidationError

Returns a new instance of ValidationError.



18
19
20
21
22
# File 'lib/natsuzora/contract/validator.rb', line 18

def initialize(message, path = '$')
  @path = path
  @error_message = message
  super("#{message} at #{path}")
end

Instance Attribute Details

#error_messageObject (readonly)

Returns the value of attribute error_message.



16
17
18
# File 'lib/natsuzora/contract/validator.rb', line 16

def error_message
  @error_message
end

#pathObject (readonly)

Returns the value of attribute path.



16
17
18
# File 'lib/natsuzora/contract/validator.rb', line 16

def path
  @path
end