Exception: Optionoids::Errors::UnexpectedKeys

Inherits:
StandardError
  • Object
show all
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

Instance Method Summary collapse

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(message = nil, keys: [])
  @keys = keys
  msg = message || "Unexpected keys found: #{keys.to_sentence}"
  super(msg)
end

Instance Attribute Details

#keysObject (readonly)

Returns the value of attribute keys.



33
34
35
# File 'lib/optionoids/errors.rb', line 33

def keys
  @keys
end