Exception: Tenax::InvalidOptionError

Inherits:
ConfigurationError show all
Defined in:
lib/tenax/errors.rb

Overview

Raised when a configuration option receives an invalid value.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(option:, value:, expected:, profile_name: nil) ⇒ InvalidOptionError

Returns a new instance of InvalidOptionError.



40
41
42
43
44
45
46
# File 'lib/tenax/errors.rb', line 40

def initialize(option:, value:, expected:, profile_name: nil)
  @profile_name = profile_name
  @option = option
  @value = value
  prefix = profile_name ? "profile #{profile_name.inspect}: " : ""
  super("#{prefix}#{option} #{expected}, got #{value.inspect}")
end

Instance Attribute Details

#option ⇒ Object (readonly)

Returns the value of attribute option.



38
39
40
# File 'lib/tenax/errors.rb', line 38

def option
  @option
end

#profile_name ⇒ Object (readonly)

Returns the value of attribute profile_name.



38
39
40
# File 'lib/tenax/errors.rb', line 38

def profile_name
  @profile_name
end

#value ⇒ Object (readonly)

Returns the value of attribute value.



38
39
40
# File 'lib/tenax/errors.rb', line 38

def value
  @value
end