From: Tim Hunter Date: 2008-10-08T06:39:59+09:00 Subject: Re: Looking for more Ruby-like way to create an array Steve Nicholson wrote: > I'm creating an array that is the result of the members of another array > each multiplied by 100. Here's what I have: > > converted_array = [] > original_array.each {|line| converted_array << line.to_f * 100} > > This works, but I'm wondering if there is a more idiomatically "Ruby" > way of doing it. Try map converted_array = orginal_array.map {|line| line.to_f * 100 } -- RMagick: http://rmagick.rubyforge.org/