From e0258fa04bb96000ae50073cf2fe365fb6ac32b5 Mon Sep 17 00:00:00 2001 From: kosaki Date: Wed, 9 Feb 2011 03:12:59 +0000 Subject: * array.c: documentation clarification in rotate, rotate!, index, and rindex. [ruby-core:35144] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- array.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'array.c') diff --git a/array.c b/array.c index 1c94396907..90dcf1c86e 100644 --- a/array.c +++ b/array.c @@ -1149,9 +1149,9 @@ rb_ary_fetch(int argc, VALUE *argv, VALUE ary) * ary.index {|item| block} -> int or nil * ary.index -> an_enumerator * - * Returns the index of the first object in +self+ such that is + * Returns the index of the first object in +self+ such that the object is * == to obj. If a block is given instead of an - * argument, returns first object for which block is true. + * argument, returns index of first object for which block is true. * Returns nil if no match is found. * See also Array#rindex. * @@ -1198,7 +1198,7 @@ rb_ary_index(int argc, VALUE *argv, VALUE ary) * * Returns the index of the last object in +self+ * == to obj. If a block is given instead of an - * argument, returns first object for which block is + * argument, returns index of first object for which block is * true, starting from the last object. * Returns nil if no match is found. * See also Array#index. @@ -1911,7 +1911,7 @@ rb_ary_rotate(VALUE ary, long cnt) * * Rotates +self+ in place so that the element at +cnt+ comes first, * and returns +self+. If +cnt+ is negative then it rotates in - * counter direction. + * the opposite direction. * * a = [ "a", "b", "c", "d" ] * a.rotate! #=> ["b", "c", "d", "a"] @@ -1936,11 +1936,11 @@ rb_ary_rotate_bang(int argc, VALUE *argv, VALUE ary) /* * call-seq: - * ary.rotate([cnt = 1]) -> new_ary + * ary.rotate(cnt=1) -> new_ary * - * Returns new array by rotating +self+, whose first element is the - * element at +cnt+ in +self+. If +cnt+ is negative then it rotates - * in counter direction. + * Returns new array by rotating +self+ so that the element at + * +cnt+ in +self+ is the first element of the new array. If +cnt+ + * is negative then it rotates in the opposite direction. * * a = [ "a", "b", "c", "d" ] * a.rotate #=> ["b", "c", "d", "a"] -- cgit v1.2.3