From 0d20cd496071fbca672bd4514d2eebedd74ba75d Mon Sep 17 00:00:00 2001 From: Erik Hollembeak Date: Thu, 8 May 2014 00:47:43 -0700 Subject: [PATCH] Improving example for Enumerator#peek Example irb session doesn't effectively document the behavior when peeking after an enumerator has been entirely consumed. The change more effectively demonstrates that StopIteration is raised when peeking beyond the end of the enumerator. --- enumerator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enumerator.c b/enumerator.c index 9df0103..9b0d3c7 100644 --- a/enumerator.c +++ b/enumerator.c @@ -838,7 +838,7 @@ enumerator_peek_values_m(VALUE obj) * p e.peek #=> 2 * p e.next #=> 2 * p e.next #=> 3 - * p e.next #raises StopIteration + * p e.peek #raises StopIteration * */ -- 1.9.0