Skip to content

Instantly share code, notes, and snippets.

@lukebyrne
Last active August 28, 2015 09:47
Show Gist options
  • Save lukebyrne/e45bc0059e9e6f1ba758 to your computer and use it in GitHub Desktop.
Save lukebyrne/e45bc0059e9e6f1ba758 to your computer and use it in GitHub Desktop.
require 'yaml'
require 'pp'
require 'json'
json = '{"australia":["some", "wines"]}'
regions = JSON.parse(json)
results = {}
regions.each do |key, value|
results[value] = 1
end
p results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment