From f02694ecc70359a0ad4eedcc6f386a36af841c48 Mon Sep 17 00:00:00 2001 From: Lukas Elmer Date: Wed, 2 Nov 2016 19:45:43 +0100 Subject: Update documentation of fetch The sentence `Negative values of +index+ count from the end of the array.` can be interpreted that it only holds if a block is given. Clarify it. --- mrbgems/mruby-array-ext/mrblib/array.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mrbgems/mruby-array-ext') diff --git a/mrbgems/mruby-array-ext/mrblib/array.rb b/mrbgems/mruby-array-ext/mrblib/array.rb index 04637471d..1e6d4d581 100644 --- a/mrbgems/mruby-array-ext/mrblib/array.rb +++ b/mrbgems/mruby-array-ext/mrblib/array.rb @@ -275,8 +275,9 @@ class Array # +default+ value. # # Alternatively, if a block is given it will only be executed when an - # invalid +index+ is referenced. Negative values of +index+ count from the - # end of the array. + # invalid +index+ is referenced. + # + # Negative values of +index+ count from the end of the array. # # a = [ 11, 22, 33, 44 ] # a.fetch(1) #=> 22 -- cgit v1.2.3