class FileIO::JSONExporter
Main File Exporter
Attributes
data[R]
file_name[R]
file_path[R]
Public Class Methods
new(args)
click to toggle source
# File modules/file_io.rb, line 13 def initialize(args) @file_path = args[:path] @file_name = args[:name] @data = args[:data] FileUtils.mkdir_p(file_path) unless Dir.exists? file_path end
Public Instance Methods
write()
click to toggle source
Writes the actual json files.
# File modules/file_io.rb, line 22 def write File.open(file_path+'/'+file_name, 'wb') do |file| file.write( data.to_json ) end end