diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-08 04:50:09 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-08 04:50:09 +0000 |
commit | 1dee5e34a3d397eb96db0b6bcc8e9cb9858975d0 (patch) | |
tree | 5822fdfead1635f2f78cfd0ee69bd61c217ad07f /enumerator.c | |
parent | b140b77926a6e62228f1152157d0348ff5724f89 (diff) | |
download | ruby-1dee5e34a3d397eb96db0b6bcc8e9cb9858975d0.tar.gz |
* error.c: RDoc for subclasses of Exception. [ruby-core:28394]
* cont.c: ditto
* enumerator.c: ditto
* io.c: ditto
* math.c: ditto
* numeric.c: ditto
* proc.c: ditto
* re.c: ditto
* thread.c: ditto
* transcode.c: ditto. Thanks to Run Paint for some of the documentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enumerator.c')
-rw-r--r-- | enumerator.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/enumerator.c b/enumerator.c index 91bb3be14f..64ff841a11 100644 --- a/enumerator.c +++ b/enumerator.c @@ -1021,7 +1021,22 @@ generator_each(VALUE obj) } /* - * StopIteration + * Document-class: StopIteration + * + * Raised to stop the iteration, in particular by Enumerator#next. It is + * rescued by Kernel#loop. + * + * loop do + * puts "Hello" + * raise StopIteration + * puts "World" + * end + * puts "Done!" + * + * <em>produces:</em> + * + * Hello + * Done! */ /* |