Class: Tetra::ProcessRunner::RecordingIO
- Inherits:
-
Object
- Object
- Tetra::ProcessRunner::RecordingIO
- Defined in:
- lib/tetra/facades/process_runner.rb
Overview
records bytes sent via “<<” for later use optionally echoes to another IO object
Instance Attribute Summary collapse
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
- #<<(*args) ⇒ Object
-
#initialize(io = nil) ⇒ RecordingIO
constructor
A new instance of RecordingIO.
Constructor Details
#initialize(io = nil) ⇒ RecordingIO
Returns a new instance of RecordingIO.
50 51 52 53 |
# File 'lib/tetra/facades/process_runner.rb', line 50 def initialize(io = nil) @io = io @record = "" end |
Instance Attribute Details
#record ⇒ Object (readonly)
Returns the value of attribute record.
48 49 50 |
# File 'lib/tetra/facades/process_runner.rb', line 48 def record @record end |
Instance Method Details
#<<(*args) ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/tetra/facades/process_runner.rb', line 55 def <<(*args) if @io @io.<<(*args) @io.flush end @record.<<(*args) end |