Exception: Tenax::InvalidOptionError
- Inherits:
-
ConfigurationError
- Object
- StandardError
- Error
- ConfigurationError
- Tenax::InvalidOptionError
- Defined in:
- lib/tenax/errors.rb
Overview
Raised when a configuration option receives an invalid value.
Instance Attribute Summary collapse
-
#option ⇒ Object
readonly
Returns the value of attribute option.
-
#profile_name ⇒ Object
readonly
Returns the value of attribute profile_name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(option:, value:, expected:, profile_name: nil) ⇒ InvalidOptionError
constructor
A new instance of InvalidOptionError.
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 |