Skip to content

Commit

Permalink
update rdoc.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
akr committed Mar 19, 2010
1 parent 4f74adc commit b5388e8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -2384,13 +2384,21 @@ slicebefore_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
* the block returns true for the element,
* the element is beginning of a chunk.
*
* The result enumerator yields the chunked elements as an array.
* So "each" method can be called as follows.
* The === and block is called from the first element to the last element
* of _enum_.
* The result for the first element is ignored.
*
* The result enumerator yields the chunked elements as an array for +each+
* method.
* +each+ method can be called as follows.
*
* enum.slice_before(pattern).each {|ary| ... }
* enum.slice_before {|elt| bool }.each {|ary| ... }
* enum.slice_before(initial_state) {|elt, state| bool }.each {|ary| ... }
*
* Other methods of Enumerator class and Enumerable module,
* such as map, etc., are also usable.
*
* For example, iteration over ChangeLog entries can be implemented as
* follows.
*
Expand Down

0 comments on commit b5388e8

Please sign in to comment.