Class: GreenPepper::FileOutput
- Inherits:
-
Object
- Object
- GreenPepper::FileOutput
- Defined in:
- lib/greenpepper/writer/output.rb
Instance Method Summary collapse
-
#initialize(output_document) ⇒ FileOutput
constructor
A new instance of FileOutput.
- #print_output(result) ⇒ Object
Constructor Details
#initialize(output_document) ⇒ FileOutput
Returns a new instance of FileOutput.
8 9 10 |
# File 'lib/greenpepper/writer/output.rb', line 8 def initialize(output_document) @output_document = output_document end |
Instance Method Details
#print_output(result) ⇒ Object
12 13 14 15 16 |
# File 'lib/greenpepper/writer/output.rb', line 12 def print_output(result) dir = File.dirname @output_document Dir.mkdir(dir) unless File.exists? dir File.open(@output_document, "w") { |f| f.write result } end |