I'm learning Ruby and I would like to know how to pick each :values I have stored in all the hashes inside an array at once. The data structure looks like this (with more hashes):
[ { :label => "Grid Singularity ", :values => [44, 1] }, { :label => "iamsmart ", :values => [44, 1] } ] If I do:
data_hash[0][:values] #=> [44, 1] I can get the values of the first hash, but, how can I select each :values array at once? My goal is to be able to do the same operation with each :values without having to select them one by one (it's a very long list!)
Thank you so much for your help!
data_hashis actually an array.