1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
kosaki 2011-02-09 03:12:59 +00:00
parent acda9a6872
commit e0258fa04b
2 changed files with 13 additions and 8 deletions

View file

@ -1,3 +1,8 @@
Tue Feb 8 11:47:11 2011 Loren Sands-Ramshaw <lorensr@gmail.com>
* array.c: documentation clarification in rotate, rotate!,
index, and rindex. [ruby-core:35144]
Wed Feb 9 09:45:43 2011 NAKAMURA Usaku <usa@ruby-lang.org> Wed Feb 9 09:45:43 2011 NAKAMURA Usaku <usa@ruby-lang.org>
* test/rdoc/test_rdoc_encoding.rb: remove unnecessary (and wrong) * test/rdoc/test_rdoc_encoding.rb: remove unnecessary (and wrong)

16
array.c
View file

@ -1149,9 +1149,9 @@ rb_ary_fetch(int argc, VALUE *argv, VALUE ary)
* ary.index {|item| block} -> int or nil * ary.index {|item| block} -> int or nil
* ary.index -> an_enumerator * 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
* <code>==</code> to <i>obj</i>. If a block is given instead of an * <code>==</code> to <i>obj</i>. If a block is given instead of an
* argument, returns first object for which <em>block</em> is true. * argument, returns index of first object for which <em>block</em> is true.
* Returns <code>nil</code> if no match is found. * Returns <code>nil</code> if no match is found.
* See also <code>Array#rindex</code>. * See also <code>Array#rindex</code>.
* *
@ -1198,7 +1198,7 @@ rb_ary_index(int argc, VALUE *argv, VALUE ary)
* *
* Returns the index of the last object in +self+ * Returns the index of the last object in +self+
* <code>==</code> to <i>obj</i>. If a block is given instead of an * <code>==</code> to <i>obj</i>. If a block is given instead of an
* argument, returns first object for which <em>block</em> is * argument, returns index of first object for which <em>block</em> is
* true, starting from the last object. * true, starting from the last object.
* Returns <code>nil</code> if no match is found. * Returns <code>nil</code> if no match is found.
* See also <code>Array#index</code>. * See also <code>Array#index</code>.
@ -1911,7 +1911,7 @@ rb_ary_rotate(VALUE ary, long cnt)
* *
* Rotates +self+ in place so that the element at +cnt+ comes first, * Rotates +self+ in place so that the element at +cnt+ comes first,
* and returns +self+. If +cnt+ is negative then it rotates in * and returns +self+. If +cnt+ is negative then it rotates in
* counter direction. * the opposite direction.
* *
* a = [ "a", "b", "c", "d" ] * a = [ "a", "b", "c", "d" ]
* a.rotate! #=> ["b", "c", "d", "a"] * a.rotate! #=> ["b", "c", "d", "a"]
@ -1936,11 +1936,11 @@ rb_ary_rotate_bang(int argc, VALUE *argv, VALUE ary)
/* /*
* call-seq: * 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 * Returns new array by rotating +self+ so that the element at
* element at +cnt+ in +self+. If +cnt+ is negative then it rotates * +cnt+ in +self+ is the first element of the new array. If +cnt+
* in counter direction. * is negative then it rotates in the opposite direction.
* *
* a = [ "a", "b", "c", "d" ] * a = [ "a", "b", "c", "d" ]
* a.rotate #=> ["b", "c", "d", "a"] * a.rotate #=> ["b", "c", "d", "a"]