Exception: ZeroRuby::CoercionError
- Defined in:
- lib/zero_ruby/errors.rb
Overview
Raised when a value cannot be coerced to the expected type
Instance Attribute Summary collapse
-
#expected_type ⇒ Object
readonly
Returns the value of attribute expected_type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(message, value: nil, expected_type: nil) ⇒ CoercionError
constructor
A new instance of CoercionError.
Methods inherited from Error
Constructor Details
#initialize(message, value: nil, expected_type: nil) ⇒ CoercionError
Returns a new instance of CoercionError.
31 32 33 34 35 |
# File 'lib/zero_ruby/errors.rb', line 31 def initialize(, value: nil, expected_type: nil) @value = value @expected_type = expected_type super() end |
Instance Attribute Details
#expected_type ⇒ Object (readonly)
Returns the value of attribute expected_type.
29 30 31 |
# File 'lib/zero_ruby/errors.rb', line 29 def expected_type @expected_type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
29 30 31 |
# File 'lib/zero_ruby/errors.rb', line 29 def value @value end |