Class: Isono::Util::EmSystemCb
- Inherits:
-
EventMachine::Connection
- Object
- EventMachine::Connection
- Isono::Util::EmSystemCb
- Defined in:
- lib/isono/util.rb
Instance Method Summary collapse
-
#initialize(io, in_buf, exit_cb) ⇒ EmSystemCb
constructor
A new instance of EmSystemCb.
- #post_init ⇒ Object
- #receive_data(data) ⇒ Object
- #unbind ⇒ Object
Constructor Details
#initialize(io, in_buf, exit_cb) ⇒ EmSystemCb
Returns a new instance of EmSystemCb.
121 122 123 124 125 |
# File 'lib/isono/util.rb', line 121 def initialize(io, in_buf, exit_cb) @io = io @in_buf = in_buf @exit_cb = exit_cb end |
Instance Method Details
#post_init ⇒ Object
127 128 129 130 131 132 |
# File 'lib/isono/util.rb', line 127 def post_init # send data to stdin for child process if @in_buf send_data @in_buf end end |
#receive_data(data) ⇒ Object
134 135 136 |
# File 'lib/isono/util.rb', line 134 def receive_data data @io.write(data) end |
#unbind ⇒ Object
138 139 140 |
# File 'lib/isono/util.rb', line 138 def unbind() @exit_cb.call(get_status) end |