Ruby mapping array into hash

Viewed 6771

I have a 2D array with each row like:

['John', 'M', '34']

I want to map into an array of Hash with each hash like:

{:Name=>"John", :Gender=>"M", :Age=>"34"}

Is there an elegant way of doing that?

5 Answers
Related