Exception: ComicInfo::Errors::TypeCoercionError
- Inherits:
-
ComicInfoError
- Object
- StandardError
- ComicInfoError
- ComicInfo::Errors::TypeCoercionError
- Defined in:
- lib/comicinfo/errors.rb
Overview
Error raised when type coercion fails
Instance Attribute Summary collapse
-
#expected_type ⇒ Object
readonly
Returns the value of attribute expected_type.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(field, value, expected_type) ⇒ TypeCoercionError
constructor
A new instance of TypeCoercionError.
Constructor Details
#initialize(field, value, expected_type) ⇒ TypeCoercionError
Returns a new instance of TypeCoercionError.
49 50 51 52 53 54 |
# File 'lib/comicinfo/errors.rb', line 49 def initialize field, value, expected_type @field = field @value = value @expected_type = expected_type super("Cannot convert value '#{value}' for field '#{field}' to #{expected_type}") end |
Instance Attribute Details
#expected_type ⇒ Object (readonly)
Returns the value of attribute expected_type.
47 48 49 |
# File 'lib/comicinfo/errors.rb', line 47 def expected_type @expected_type end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
47 48 49 |
# File 'lib/comicinfo/errors.rb', line 47 def field @field end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
47 48 49 |
# File 'lib/comicinfo/errors.rb', line 47 def value @value end |