1require 'json'
2File.open("filename.json", "w") do |f|
3 f.write(JSON.pretty_generate(my_hash))
4end
1response = Faraday.get('https://api.github.com/users/your_username')
2r = JSON.parse(response.body, symbolize_names: true)
3#OR
4JSON.parse(response.body)
5#'symbolize_names' turns the keys in this hash into symbols, not required
6#JSON.parse is what turns the JSON object into a hash