Exception: Optionoids::Errors::UnexpectedNilValue

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

Overview

Custom error class to indicate that some values are unexpectedly nil

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of UnexpectedNilValue.



79
80
81
82
83
# File 'lib/optionoids/errors.rb', line 79

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

Instance Attribute Details

#keysObject (readonly)

Returns the value of attribute keys.



77
78
79
# File 'lib/optionoids/errors.rb', line 77

def keys
  @keys
end