Exception: Optionoids::Errors::RequiredDataUnavailable

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

Overview

Custom error class to indicate that a checker requires keys in #keys or key/values in the current option Hash, but none were provided.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, check: nil) ⇒ RequiredDataUnavailable

Returns a new instance of RequiredDataUnavailable.



13
14
15
16
17
# File 'lib/optionoids/errors.rb', line 13

def initialize(message = nil, check: nil)
  msg = message || "Required data is unavailable for the check '#{check}'"
  @check = check
  super(msg)
end

Instance Attribute Details

#checkObject (readonly)

Returns the value of attribute check.



11
12
13
# File 'lib/optionoids/errors.rb', line 11

def check
  @check
end