Class: Mediakit::Process::Runner::IOWatcher
- Inherits:
-
Coolio::IO
- Object
- Coolio::IO
- Mediakit::Process::Runner::IOWatcher
- Defined in:
- lib/mediakit/process/runner.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(io, &block) ⇒ IOWatcher
constructor
A new instance of IOWatcher.
- #on_close ⇒ Object
- #on_read(data) ⇒ Object
Constructor Details
#initialize(io, &block) ⇒ IOWatcher
Returns a new instance of IOWatcher.
113 114 115 116 117 |
# File 'lib/mediakit/process/runner.rb', line 113 def initialize(io, &block) @block = block @data = '' super end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
111 112 113 |
# File 'lib/mediakit/process/runner.rb', line 111 def data @data end |
Instance Method Details
#on_close ⇒ Object
124 125 126 |
# File 'lib/mediakit/process/runner.rb', line 124 def on_close @block = nil end |
#on_read(data) ⇒ Object
119 120 121 122 |
# File 'lib/mediakit/process/runner.rb', line 119 def on_read(data) @block.call(data) @data << data end |