Skip to content

Commit

Permalink
rdoc update.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
akr committed Oct 11, 2009
1 parent bffae00 commit 3e54f0e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -2240,13 +2240,14 @@ slicebefore_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
* The duplicated object is passed to 2nd argument of the block for
* +slice_before+ method.
*
* # word wrapping
* def wordwrap(words, width)
* # word wrapping.
* # this assumes all characters have same width.
* def wordwrap(words, maxwidth)
* # if cols is a local variable, 2nd "each" may start with non-zero cols.
* words.slice_before(cols: 0) {|w, h|
* h[:cols] += 1 if h[:cols] != 0
* h[:cols] += w.length
* if width < h[:cols]
* if maxwidth < h[:cols]
* h[:cols] = w.length
* true
* else
Expand Down

0 comments on commit 3e54f0e

Please sign in to comment.