Exception: Optionoids::Errors::UnexpectedPopulatedValue

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

Overview

Custom error class to indicate that some values are unexpectedly populated (not blank)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of UnexpectedPopulatedValue.



57
58
59
60
61
# File 'lib/optionoids/errors.rb', line 57

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

Instance Attribute Details

#keysObject (readonly)

Returns the value of attribute keys.



55
56
57
# File 'lib/optionoids/errors.rb', line 55

def keys
  @keys
end