class JsonFile

Public Class Methods

convert_json_file(json_object) click to toggle source
# File lib/nation/templates/json_file.rb, line 4
def self.convert_json_file(json_object)

  path = "./nation_files/json" 
  file_name = "#{json_object[:name]}_info_#{Time.now.strftime("%d%m%Y%H%M")}.json"
  Dir.mkdir(path) if Dir.exist?(path) == false

  File.open("#{path}/#{file_name}", "w+") do |f|
    f.write(json_object.to_json)
  end
end