I am trying to combine multiple arrays of hashes in a ruby ββusing a shared key. For instance:
country_info = [ {country_id: "US", country_desc: "United States"}, {country_id: "AU", country_desc: "Australia"} ] country_stats = [ {country_id:"US", pageviews: 150}, {country_id:"AU", pageviews: 200} ] i_want = [ {country_id: "US", country_desc: "United States", pageviews:150}, {country_id: "AU", country_desc: "Australia", pageviews:200} ]
This is something like the pv.nest protovis function in Javascript. See: http://protovis-js.googlecode.com/svn/trunk/jsdoc/symbols/pv.Nest.html
How can I do this in Ruby?
source share