Exception: Optionoids::Errors::UnexpectedKeys
- Inherits:
-
StandardError
- Object
- StandardError
- Optionoids::Errors::UnexpectedKeys
- Defined in:
- lib/optionoids/errors.rb
Overview
Custom error class to indicate that unexpected keys are in the current option Hash
Instance Attribute Summary collapse
-
#keys ⇒ Object
readonly
Returns the value of attribute keys.
Instance Method Summary collapse
-
#initialize(message = nil, keys: []) ⇒ UnexpectedKeys
constructor
A new instance of UnexpectedKeys.
Constructor Details
#initialize(message = nil, keys: []) ⇒ UnexpectedKeys
Returns a new instance of UnexpectedKeys.
35 36 37 38 39 |
# File 'lib/optionoids/errors.rb', line 35 def initialize( = nil, keys: []) @keys = keys msg = || "Unexpected keys found: #{keys.to_sentence}" super(msg) end |
Instance Attribute Details
#keys ⇒ Object (readonly)
Returns the value of attribute keys.
33 34 35 |
# File 'lib/optionoids/errors.rb', line 33 def keys @keys end |