Exception: Attestor::InvalidError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/attestor/invalid_error.rb

Overview

The exception to be raised when an unsafe validation fails

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, messages = nil) ⇒ InvalidError

Returns a new instance of InvalidError.


9
10
11
12
13
# File 'lib/attestor/invalid_error.rb', line 9

def initialize(object, messages = nil)
  @object   = object
  @messages = Array(messages)
  freeze
end

Instance Attribute Details

#messagesArray<String> (readonly)

The list of validation error messages

Returns:

  • (Array<String>)

25
26
27
# File 'lib/attestor/invalid_error.rb', line 25

def messages
  @messages
end

#objectObject (readonly)

The invalid object

Returns:

  • (Object)

19
20
21
# File 'lib/attestor/invalid_error.rb', line 19

def object
  @object
end