Class: Logging::IO::Pipe
Overview
Write to a named pipe.
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(label, path) ⇒ Pipe
constructor
A new instance of Pipe.
- #pipe ⇒ Object
- #write(message) ⇒ Object
Methods inherited from Raw
#write_multiple_messages, #write_single_message
Constructor Details
#initialize(label, path) ⇒ Pipe
Returns a new instance of Pipe.
83 84 85 |
# File 'lib/logging/io.rb', line 83 def initialize(label, path) @label, @path = label, path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
82 83 84 |
# File 'lib/logging/io.rb', line 82 def path @path end |
Instance Method Details
#pipe ⇒ Object
87 88 89 90 |
# File 'lib/logging/io.rb', line 87 def pipe # The w+ means we don't block. @pipe ||= open(self.path, 'w+') end |
#write(message) ⇒ Object
92 93 94 95 |
# File 'lib/logging/io.rb', line 92 def write() self.pipe.puts() self.pipe.flush end |