Why is this Ruby 1.9 code resulting in an empty hash?
- by randombits
I'm trying to zip 3 arrays into a hash. The hash is coming up empty, though. Here's sample code to reproduce using Ruby 1.9:
>> foo0 = ["a"]
=> ["a"]
>> foo1 = ["b"]
=> ["b"]
>> foo2 = ["c"]
=> ["c"]
>> h = Hash[foo0.zip(foo1, foo2)]
=> {}