I have a ruby array of hashes
arr1 = [:a => {:name=>"Bob",:age=>"10",:city=>"NY"},
:b => {:name=>"Mike",:age=>"20",:city=>"FL"}]
What is the best way to convert this to
arr2 = [["Bob",10],["Mike",20]]
in ruby.
Use map.
arr1.first.values.map{|h| [h[:name], h[:age].to_i]}