I have the following JSON-Structure:
{ "A" : "1", "B" : "2", "RandomOtherName" : "54738" }
How can I extract the key values ("A"
, "B"
, "RandomOtherName"
,...) in ruby (Preferably in to an array)?
require 'json'
data = '{ "A" : "1", "B" : "2", "RandomOtherName" : "54738" }'
JSON.parse(data).keys # => ["A", "B", "RandomOtherName"]