Exception: Virtus::CoercionError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(output, primitive) ⇒ CoercionError

Returns a new instance of CoercionError.



16
17
18
19
# File 'lib/virtus.rb', line 16

def initialize(output, primitive)
  @output, @primitive = output, primitive
  super("Failed to coerce #{output.inspect} into #{primitive.inspect}")
end

Instance Attribute Details

#outputObject (readonly)



14
15
16
# File 'lib/virtus.rb', line 14

def output
  @output
end

#primitiveObject (readonly)



14
15
16
# File 'lib/virtus.rb', line 14

def primitive
  @primitive
end