From: Antonio Cangiano Date: 2009-02-26T22:17:41+09:00 Subject: Re: store all the values in a new array --0016361e82525e82600463d23041 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Thu, Feb 26, 2009 at 4:39 AM, Florian Gilcher wrote: > values = ary.collect {|elem| elem.ticket_fees } > > In Rails and newer Ruby environments, you can also do this: > > values = ary.collect( &:ticket_fees ) > But be careful with the latter form (known as "symbol to proc"). In Ruby 1.8 it's much slower than using a regular block. Cheers, Antonio -- http://antoniocangiano.com - Zen and the Art of Programming http://math-blog.com - Mathematics is wonderful! http://stacktrace.it - Aperiodico di resistenza informatica Follow me on Twitter: http://twitter.com/acangiano Recently completed "Ruby on Rails for Microsoft Developers" for Wrox. --0016361e82525e82600463d23041--