Exception: Apia::InvalidEnumOptionError
- Inherits:
-
RuntimeError
- Object
- StandardError
- StandardError
- RuntimeError
- Apia::InvalidEnumOptionError
- Defined in:
- lib/apia/errors/invalid_enum_option_error.rb
Instance Attribute Summary collapse
-
#enum ⇒ Object
readonly
Returns the value of attribute enum.
-
#given_value ⇒ Object
readonly
Returns the value of attribute given_value.
Instance Method Summary collapse
-
#initialize(enum, given_value) ⇒ InvalidEnumOptionError
constructor
A new instance of InvalidEnumOptionError.
- #to_s ⇒ Object
Methods inherited from RuntimeError
Constructor Details
#initialize(enum, given_value) ⇒ InvalidEnumOptionError
Returns a new instance of InvalidEnumOptionError.
11 12 13 14 |
# File 'lib/apia/errors/invalid_enum_option_error.rb', line 11 def initialize(enum, given_value) @enum = enum @given_value = given_value end |
Instance Attribute Details
#enum ⇒ Object (readonly)
Returns the value of attribute enum.
8 9 10 |
# File 'lib/apia/errors/invalid_enum_option_error.rb', line 8 def enum @enum end |
#given_value ⇒ Object (readonly)
Returns the value of attribute given_value.
9 10 11 |
# File 'lib/apia/errors/invalid_enum_option_error.rb', line 9 def given_value @given_value end |
Instance Method Details
#to_s ⇒ Object
16 17 18 |
# File 'lib/apia/errors/invalid_enum_option_error.rb', line 16 def to_s "Invalid option for `#{enum.class.definition.name || 'AnonymousEnum'}` (got: #{@given_value.inspect} (#{@given_value.class}))" end |