Exception: Optionoids::Errors::MissingKeys

Inherits:
StandardError
  • Object
show all
Defined in:
lib/optionoids/errors.rb

Overview

Custom error class to indicate the expected keys are not present in the current option Hash

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, keys: []) ⇒ MissingKeys

Returns a new instance of MissingKeys.



24
25
26
27
28
# File 'lib/optionoids/errors.rb', line 24

def initialize(message = nil, keys: [])
  @keys = keys
  msg = message || "Missing required keys: #{keys.to_sentence}"
  super(msg)
end

Instance Attribute Details

#keysObject (readonly)

Returns the value of attribute keys.



22
23
24
# File 'lib/optionoids/errors.rb', line 22

def keys
  @keys
end