Class: WriteLog
- Inherits:
-
Object
- Object
- WriteLog
- Defined in:
- lib/roma/tools/log_merger.rb
Instance Method Summary collapse
- #close_file ⇒ Object
-
#initialize(fn) ⇒ WriteLog
constructor
A new instance of WriteLog.
- #write_line(th, l) ⇒ Object
Constructor Details
#initialize(fn) ⇒ WriteLog
Returns a new instance of WriteLog.
54 55 56 57 58 59 60 |
# File 'lib/roma/tools/log_merger.rb', line 54 def initialize(fn) if fn == $stdout then @f = $stdout else @f = open(fn, "w") end end |
Instance Method Details
#close_file ⇒ Object
67 68 69 70 71 |
# File 'lib/roma/tools/log_merger.rb', line 67 def close_file unless @f.closed? @f.close end end |
#write_line(th, l) ⇒ Object
62 63 64 65 |
# File 'lib/roma/tools/log_merger.rb', line 62 def write_line(th, l) buff = th << ',' << l @f.write(buff) end |