We have the following datastructures:
{:a => [\"val1\", \"val2\"], :b => [\"valb1\", \"valb2\"], ...}
And I want to turn that into >
This will work assuming all the arrays in the original hash are the same size:
hash_array = hash.first[1].map { {} } hash.each do |key,arr| hash_array.zip(arr).each {|inner_hash, val| inner_hash[key] = val} end