Reputation: 238667
I have an array of data and an array of keys that are in a specific order:
original_data = ['hello', 'world', 'one', 'two']
keys = [:greeting, :location, :first, :second]
I would like to map the keys to the data to be able to reference each datum by a key like this.
data[:greeting].should == original_data[0]
How can I achieve this?
Upvotes: 0
Views: 40