Class: Dumpable::FileWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/dumpable/file_writer.rb

Class Method Summary collapse

Class Method Details

.write(lines, options) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/dumpable/file_writer.rb', line 3

def self.write(lines, options)
  if options[:file]
    File.open(options[:file], "w") do |file|
      file.puts lines
    end
  else
    lines.each do |line|
      puts line
    end
  end
  nil
end