summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-27 14:44:43 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-27 14:44:43 +0000
commit9278fab680e2bbbe9e443ad8ef2cec631800de2e (patch)
tree230e8f6b010e6c8450f29aefb17ca5ab91242fd6 /enum.c
parent4319c0235d129e9a535432703e38a032fcf33e8f (diff)
rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/enum.c b/enum.c
index 99a59e574e..d3503b1f5f 100644
--- a/enum.c
+++ b/enum.c
@@ -2067,6 +2067,14 @@ chunk_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
* # "\n"]
* # ...
*
+ * paragraphs separated by empty lines can be parsed as follows.
+ *
+ * File.foreach("README").chunk {|line|
+ * /\A\s*\z/ !~ line || nil
+ * }.each {|_, lines|
+ * pp lines
+ * }
+ *
* :_alone can be used to pass through bunch of elements.
* For example, sort consective lines formed as Foo#bar and
* pass other lines, chunk can be used as follows.