Class: Mediakit::Process::Runner::IOWatcher

Inherits:
Coolio::IO
  • Object
show all
Defined in:
lib/mediakit/process/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dataObject (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_closeObject



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