Class: Confium::IndexError
- Inherits:
-
Error
- Object
- Error
- Confium::IndexError
- Defined in:
- lib/confium/errors/index_error.rb
Overview
Raised when an out-of-range index is supplied.
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#valid_range ⇒ Object
readonly
Returns the value of attribute valid_range.
Instance Method Summary collapse
-
#initialize(message = nil, details_hash = nil, **kwargs) ⇒ IndexError
constructor
A new instance of IndexError.
Constructor Details
#initialize(message = nil, details_hash = nil, **kwargs) ⇒ IndexError
Returns a new instance of IndexError.
7 8 9 10 11 12 |
# File 'lib/confium/errors/index_error.rb', line 7 def initialize( = nil, details_hash = nil, **kwargs) , kwargs = Confium::Errors::Coerce.args(, details_hash, kwargs) @index = kwargs.delete(:index) @valid_range = kwargs.delete(:valid_range) super(, details: { index: @index, valid_range: @valid_range, **kwargs }) end |
Instance Attribute Details
#index ⇒ Object (readonly)
Returns the value of attribute index.
5 6 7 |
# File 'lib/confium/errors/index_error.rb', line 5 def index @index end |
#valid_range ⇒ Object (readonly)
Returns the value of attribute valid_range.
5 6 7 |
# File 'lib/confium/errors/index_error.rb', line 5 def valid_range @valid_range end |