summaryrefslogtreecommitdiff
path: root/enumerator.c
diff options
context:
space:
mode:
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c17
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!
*/
/*