summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-array-ext
diff options
context:
space:
mode:
authorLukas Elmer <[email protected]>2016-11-02 19:45:43 +0100
committerGitHub <[email protected]>2016-11-02 19:45:43 +0100
commitf02694ecc70359a0ad4eedcc6f386a36af841c48 (patch)
treeaa0c79a31260006d3cb58c2da163779c0ddece7b /mrbgems/mruby-array-ext
parentcc3f1b7f5cccd652c4348d28f3e678a9ea3ac520 (diff)
downloadmruby-f02694ecc70359a0ad4eedcc6f386a36af841c48.tar.gz
mruby-f02694ecc70359a0ad4eedcc6f386a36af841c48.zip
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.
Diffstat (limited to 'mrbgems/mruby-array-ext')
-rw-r--r--mrbgems/mruby-array-ext/mrblib/array.rb5
1 files changed, 3 insertions, 2 deletions
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