I have two arrays
a = [:foo, :bar, :baz, :bof]
and
b = ["hello", "world", 1, 2]
I want
{:foo => "hello", :bar => "world", :baz => 1, :bof => 2}
Any way to do this?
I have two arrays
a = [:foo, :bar, :baz, :bof]
and
b = ["hello", "world", 1, 2]
I want
{:foo => "hello", :bar => "world", :baz => 1, :bof => 2}
Any way to do this?
...damn, I love Ruby.
Just wanted to point out that there's a slightly cleaner way of doing this:
Have to agree on the "I love Ruby" part though!
How about this one?
If you use Ruby 1.9:
I feel
a.zip(b)
looks likea
is master andb
is slave, but in this style they are flat.