Exception: Rasti::Form::MultiCastError
- Inherits:
-
StandardError
- Object
- StandardError
- Rasti::Form::MultiCastError
- Defined in:
- lib/rasti/form/errors.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #display_value ⇒ Object
-
#initialize(type, value, errors) ⇒ MultiCastError
constructor
A new instance of MultiCastError.
- #message ⇒ Object
Constructor Details
#initialize(type, value, errors) ⇒ MultiCastError
Returns a new instance of MultiCastError.
30 31 32 33 34 |
# File 'lib/rasti/form/errors.rb', line 30 def initialize(type, value, errors) @type = type @value = value @errors = errors end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
28 29 30 |
# File 'lib/rasti/form/errors.rb', line 28 def errors @errors end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
28 29 30 |
# File 'lib/rasti/form/errors.rb', line 28 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
28 29 30 |
# File 'lib/rasti/form/errors.rb', line 28 def value @value end |
Instance Method Details
#display_value ⇒ Object
40 41 42 |
# File 'lib/rasti/form/errors.rb', line 40 def display_value value.is_a?(::String) ? "'#{value}'" : value.inspect end |
#message ⇒ Object
36 37 38 |
# File 'lib/rasti/form/errors.rb', line 36 def "Invalid cast: #{display_value} -> #{type} - #{JSON.dump(errors)}" end |