Итак, я пытаюсь получить доступ к полю "country_code", но это массив в хеше: companies, поэтому я не знаю, как получить к нему доступ / сделать его хешем для доступа к нему
{:message=>{"text"=>"OK", "code"=>0, "version"=>"1.1.1"}, :businesses=>[{"rating_img_url"=>"http://media1.ct.yelpcdn.com/static/201012164084228337/i/ico/stars/stars_4.png", "country_code"=>"US", obj = ActiveSupport::JSON.decode(Net::HTTP.get_response(URI.parse("http://url")).body).to_options
Вы можете попробовать это:
obj[:businesses][0]['country_code']
country_code = obj[":businesses"][0].country_code