module Nidyx::Output
Public Instance Methods
write(models, dir)
click to toggle source
@param models [Hash] a full hash of models to output @param dir [String] output directory, defaults to current directory
# File lib/nidyx/output.rb, line 7 def write(models, dir) path = dir || Dir.getwd models.each { |model| write_file(model, path) } end
Private Instance Methods
write_file(model, path)
click to toggle source
@param model [Hash] all of the files for a specific model, stored in @param path [String] output directory a hash by extension
# File lib/nidyx/output.rb, line 17 def write_file(model, path) model.files.each do |file| File.open(File.join(path, file.file_name), "w") do |f| f.puts file.render end end end