I assume you mean’t Hashes and not Arrays?
This assumes the elements are in the same order:
names = {:one => “one”, :two => “two”} data = {“one” => “foo”, “two” => “bar”}
hash = {} names.values.zip(data.values).each {|key, value| hash[key] = value} hash => {“two”=>“bar”, “one”=>“foo”}