Exception: Optionoids::Errors::UnexpectedNonNilValue

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

Overview

Custom error class to indicate that some values are unexpectedly not nil

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of UnexpectedNonNilValue.



68
69
70
71
72
# File 'lib/optionoids/errors.rb', line 68

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

Instance Attribute Details

#keysObject (readonly)

Returns the value of attribute keys.



66
67
68
# File 'lib/optionoids/errors.rb', line 66

def keys
  @keys
end