Class: Logging::IO::File
Overview
Write to a file.
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Attributes inherited from Base
Instance Method Summary collapse
- #file ⇒ Object
-
#initialize(label, path) ⇒ File
constructor
A new instance of File.
- #write(message) ⇒ Object
Methods inherited from Raw
#write_multiple_messages, #write_single_message
Constructor Details
#initialize(label, path) ⇒ File
Returns a new instance of File.
50 51 52 |
# File 'lib/logging/io.rb', line 50 def initialize(label, path) @label, @path = label, path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
49 50 51 |
# File 'lib/logging/io.rb', line 49 def path @path end |
Instance Method Details
#file ⇒ Object
54 55 56 |
# File 'lib/logging/io.rb', line 54 def file @file ||= File.open(self.path, 'a') end |
#write(message) ⇒ Object
58 59 60 |
# File 'lib/logging/io.rb', line 58 def write() file.puts() end |