Exception: IndexError
- Inherits:
-
StandardError
- Object
- Exception
- StandardError
- IndexError
- Defined in:
- error.c,
error.c
Overview
Raised when the given index is invalid.
a = [:foo, :bar]
a.fetch(0) #=> :foo
a[4] #=> nil
a.fetch(4) #=> IndexError: index 4 outside of array bounds: -2...2
Direct Known Subclasses
Method Summary
Methods inherited from Exception
#==, #backtrace, #backtrace_locations, #cause, #exception, exception, #initialize, #inspect, #message, #set_backtrace, #to_s
Constructor Details
This class inherits a constructor from Exception