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, #detailed_message, #exception, exception, #full_message, #initialize, #inspect, #message, #set_backtrace, #to_s, to_tty?
Constructor Details
This class inherits a constructor from Exception