Exception: Attributor::InvalidDefinition

Inherits:
StandardError
  • Object
show all
Defined in:
lib/attributor/types/hash.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, cause) ⇒ InvalidDefinition

Returns a new instance of InvalidDefinition


3
4
5
6
7
8
9
10
11
12
13
# File 'lib/attributor/types/hash.rb', line 3

def initialize(type, cause)
  type_name = if type.name
    type.name
  else
    type.inspect
  end

  msg = "Structure definition for type #{type_name} is invalid. The following exception has occurred: #{cause.inspect}"
  super(msg)
  @cause = cause
end

Instance Attribute Details

#causeObject (readonly)

Returns the value of attribute cause


15
16
17
# File 'lib/attributor/types/hash.rb', line 15

def cause
  @cause
end