I have two arrays
a = [:foo, :bar, :baz, :bof]
and
b = [\"hello\", \"world\", 1, 2]
I want
How about this one?
[a, b].transpose.to_h
If you use Ruby 1.9:
Hash[ [a, b].transpose ]
I feel a.zip(b) looks like a is master and b is slave, but in this style they are flat.
a.zip(b)
a
b