From: William James Date: 2008-10-08T08:03:01+09:00 Subject: Re: Looking for more Ruby-like way to create an array On Oct 7, 4:33 pm, 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. > -- > Posted viahttp://www.ruby-forum.com/. irb(main):001:0> a = 2,3,5,8 => [2, 3, 5, 8] irb(main):002:0> a.map!{|n| n*10 } => [20, 30, 50, 80] irb(main):003:0> a => [20, 30, 50, 80]