ruby write json to file

Solutions on MaxInterview for ruby write json to file by the best coders in the world

showing results for - "ruby write json to file"
Jordan
13 Jan 2016
1require 'json'
2File.open("filename.json", "w") do |f|
3  f.write(JSON.pretty_generate(my_hash))
4end