Eero Saynatkari
10/2/2006 4:53:00 PM
On 2006.10.03 01:45, Wes Gamble wrote:
> I have this:
>
> FILTER_COLUMNS = Array.new
> DISPLAYABLE_COLUMNS.each do |field_array|
> FILTER_COLUMNS << [ field_array[1], field_array[0] ]
> end
>
> Is there any way to write this so that it could look something like:
>
> FILTER_COLUMNS = DISPLAYABLE_COLUMNS.each do |field_array|
> ??? << [ field_array[1], field_array[0] ]
> end
Take a look at Enumerable, specifically #inject.