I parse the response:
response = JSON.parse(response.body)
p response
Output
{"PC"=>"PC087849", "COUNT"=>"72421"}
{"PC"=>"PC087302", "COUNT"=>"71546"}
{"PC"=>"PC087255", "COUNT"=>"68420"}
Then remap the keys:
a = response.map{|s| {label: s[0], value: s[1].to_i} }
puts a
Output
{:label=>nil, :value=>0}
{:label=>nil, :value=>0}
{:label=>nil, :value=>0}
Why are the contents of the Key's nil and zero?
Thanks.