From 1a58d10a56d070cf79a73dafa2c7b4baeece056b Mon Sep 17 00:00:00 2001 From: Gabriel Gilder Date: Wed, 4 Jun 2014 00:01:00 -0700 Subject: [PATCH] Clarify documentation for Array#insert --- array.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/array.c b/array.c index 3f56055..38e0378 100644 --- a/array.c +++ b/array.c @@ -1742,7 +1742,9 @@ fixnum: * Inserts the given values before the element with the given +index+. * * Negative indices count backwards from the end of the array, where +-1+ is - * the last element. + * the last element. If a negative index is used, the given values will be + * inserted after that element, so using an index of +-1+ will insert the + * values at the end of the array. * * a = %w{ a b c d } * a.insert(2, 99) #=> ["a", "b", 99, "c", "d"] -- 1.8.5.2 (Apple Git-48)