ary.fetch(index) â objary.fetch(index, default) â objary.fetch(index) { |index| block } â obj
Instance Public methods
Tries to return the element at position index, but throws an
IndexError exception if the referenced
index lies outside of the array bounds. This error can be
prevented by supplying a second argument, which will act as a
default value.
Alternatively, if a block is given it will only be executed when an invalid
index is referenced. Neg