Class: Catamaran::OutputFile
- Inherits:
-
Object
- Object
- Catamaran::OutputFile
- Defined in:
- lib/catamaran/output_file.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
Returns the value of attribute filename.
Instance Method Summary collapse
-
#initialize(filename = nil) ⇒ OutputFile
constructor
A new instance of OutputFile.
- #write(line) ⇒ Object
Constructor Details
#initialize(filename = nil) ⇒ OutputFile
Returns a new instance of OutputFile.
5 6 7 |
# File 'lib/catamaran/output_file.rb', line 5 def initialize( filename = nil ) self.filename = filename end |
Instance Attribute Details
#filename ⇒ Object
Returns the value of attribute filename.
3 4 5 |
# File 'lib/catamaran/output_file.rb', line 3 def filename @filename end |
Instance Method Details
#write(line) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/catamaran/output_file.rb', line 9 def write( line ) unless @file_descriptor @file_descriptor = File.open( self.filename, "a" ) end @file_descriptor.puts( line ) @file_descriptor.flush end |