I'm a novice trying to extract the latitude and longitude values (under geometry > location) from the attached JSON.
I tried to use this legacy code without success:
results_array = ActiveSupport::JSON.decode response.body
if results_array && "OK" == results_array["status"]
results_array["results"].each do |result|
puts logger.info lat = result["geometry"]["location"]["lat"]
I figured out how to convert to key-value pairs with:
response_2 = JSON.parse(response.body)
...But still couldn't figure out how to extract the latitude and longitude.
I thought this would be obvious, but didn't find the solution through googling. Thanks a lot for your help.