Exception: Attributor::CoercionError

Inherits:
LoadError show all
Defined in:
lib/attributor/exceptions.rb

Instance Method Summary collapse

Constructor Details

#initialize(context:, from:, to:, value: nil) ⇒ CoercionError


16
17
18
19
20
# File 'lib/attributor/exceptions.rb', line 16

def initialize( context: , from: , to:, value: nil)
  msg = "Error coercing from #{from} to #{to} while loading #{Attributor.humanize_context(context)}."
  msg += " Received value #{Attributor.errorize_value(value)}" if value
  super msg
end