U:RDoc::AnyMethod[iI" fetch:ETI"Array#fetch;TF: publico:RDoc::Markup::Document: @parts[ o:RDoc::Markup::Paragraph; [ I"OTries to return the element at position +index+, but throws an IndexError ;TI"Qexception if the referenced +index+ lies outside of the array bounds. This ;TI"Perror can be prevented by supplying a second argument, which will act as a ;TI"+default+ value.;To:RDoc::Markup::BlankLineo; ; [I"IAlternatively, if a block is given it will only be executed when an ;TI"#invalid +index+ is referenced.;T@o; ; [I"@Negative values of +index+ count from the end of the array.;T@o:RDoc::Markup::Verbatim; [ I"a = [ 11, 22, 33, 44 ] ;TI"%a.fetch(1) #=> 22 ;TI"%a.fetch(-1) #=> 44 ;TI"(a.fetch(4, 'cat') #=> "cat" ;TI"7a.fetch(100) { |i| puts "#{i} is out of bounds" } ;TI"8 #=> "100 is out of bounds";T: @format0: @fileI" array.c;T:0@omit_headings_from_table_of_contents_below0I"ary.fetch(index) -> obj ary.fetch(index, default) -> obj ary.fetch(index) { |index| block } -> obj ;T0[I"(p1, p2 = v2);T@!FI" Array;TcRDoc::NormalClass00