mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
c1f78cc685
commit
be698dbc66
2 changed files with 9 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
|||
Thu Jul 11 14:48:35 2013 Zachary Scott <e@zzak.io>
|
||||
|
||||
* 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
|
||||
|
||||
Thu Jul 11 14:22:37 2013 Zachary Scott <e@zzak.io>
|
||||
|
||||
* test/drb/ut_eq.rb: Use localhost for drb tests [Bug #7311]
|
||||
|
|
6
array.c
6
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:
|
||||
|
|
Loading…
Add table
Reference in a new issue