Class: Unipept::OutputWriter
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
-
#initialize(file) ⇒ OutputWriter
constructor
A new instance of OutputWriter.
- #write_line(line) ⇒ Object
Constructor Details
#initialize(file) ⇒ OutputWriter
Returns a new instance of OutputWriter.
5 6 7 |
# File 'lib/output_writer.rb', line 5 def initialize(file) @output = file ? File.open(file, 'a') : $stdout end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
3 4 5 |
# File 'lib/output_writer.rb', line 3 def output @output end |
Instance Method Details
#write_line(line) ⇒ Object
9 10 11 |
# File 'lib/output_writer.rb', line 9 def write_line(line) @output.write line end |