summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-11 05:51:19 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-11 05:51:19 +0000
commitbe698dbc665d1e0423fa995920ac94718216bffa (patch)
treeb6fdc71405b55d247281da54acce18962eba0e04 /array.c
parentc1f78cc6850e0fcbffaa000273c3b6f33f975cb7 (diff)
* array.c: Replace confusing example for #reverse_each in overview
Patch by Earl St Sauver [Fixes documenting-ruby/ruby-12] https://github.com/documenting-ruby/ruby/pull/12 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/array.c b/array.c
index b5518bb..215f6fe 100644
--- a/array.c
+++ b/array.c
@@ -5406,10 +5406,10 @@ rb_ary_drop_while(VALUE ary)
* Another sometimes useful iterator is #reverse_each which will iterate over
* the elements in the array in reverse order.
*
- * words = %w[rats live on no evil star]
+ * words = %w[first second third fourth fifth sixth]
* str = ""
- * words.reverse_each { |word| str += "#{word.reverse} " }
- * str #=> "rats live on no evil star "
+ * words.reverse_each { |word| str += "#{word} " }
+ * p str #=> "sixth fifth fourth third second first "
*
* The #map method can be used to create a new array based on the original
* array, but with the values modified by the supplied block: