Exception: Optionoids::Errors::UnexpectedValueType
- Inherits:
-
StandardError
- Object
- StandardError
- Optionoids::Errors::UnexpectedValueType
- Defined in:
- lib/optionoids/errors.rb
Overview
Custom error class to indicate that the values for the keys are not of the expected types
Instance Attribute Summary collapse
-
#keys ⇒ Object
readonly
Returns the value of attribute keys.
-
#types ⇒ Object
readonly
Returns the value of attribute types.
Instance Method Summary collapse
-
#initialize(message = nil, keys: [], types: []) ⇒ UnexpectedValueType
constructor
A new instance of UnexpectedValueType.
Constructor Details
#initialize(message = nil, keys: [], types: []) ⇒ UnexpectedValueType
Returns a new instance of UnexpectedValueType.
101 102 103 104 105 106 107 |
# File 'lib/optionoids/errors.rb', line 101 def initialize( = nil, keys: [], types: []) @keys = keys @types = types msg = || "Unexpected value types for keys: #{keys.to_sentence}. " \ "Expected types: #{types.to_sentence}" super(msg) end |
Instance Attribute Details
#keys ⇒ Object (readonly)
Returns the value of attribute keys.
99 100 101 |
# File 'lib/optionoids/errors.rb', line 99 def keys @keys end |
#types ⇒ Object (readonly)
Returns the value of attribute types.
99 100 101 |
# File 'lib/optionoids/errors.rb', line 99 def types @types end |