Class: Microsandbox::ExecStdin
- Inherits:
-
Object
- Object
- Microsandbox::ExecStdin
- Defined in:
- lib/microsandbox/exec_handle.rb
Overview
A writer for a streamed process’s stdin, from Microsandbox::ExecHandle#stdin.
Instance Method Summary collapse
-
#close ⇒ nil
Send EOF.
-
#initialize(native) ⇒ ExecStdin
constructor
A new instance of ExecStdin.
-
#write(data) ⇒ self
Write data to the process stdin.
Constructor Details
#initialize(native) ⇒ ExecStdin
Returns a new instance of ExecStdin.
61 62 63 |
# File 'lib/microsandbox/exec_handle.rb', line 61 def initialize(native) @native = native end |
Instance Method Details
#close ⇒ nil
Send EOF.
77 78 79 80 |
# File 'lib/microsandbox/exec_handle.rb', line 77 def close @native.close nil end |
#write(data) ⇒ self
Write data to the process stdin.
69 70 71 72 73 |
# File 'lib/microsandbox/exec_handle.rb', line 69 def write(data) bytes = Microsandbox.coerce_write_bytes(data) @native.write(bytes) self end |