Class: Vito::Connection::Output
- Inherits:
-
Object
- Object
- Vito::Connection::Output
- Defined in:
- lib/vito/connection.rb
Instance Method Summary collapse
-
#initialize(stdin, stdout, stderr, thread) ⇒ Output
constructor
A new instance of Output.
- #result ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(stdin, stdout, stderr, thread) ⇒ Output
Returns a new instance of Output.
30 31 32 33 34 |
# File 'lib/vito/connection.rb', line 30 def initialize(stdin, stdout, stderr, thread) @stdout = stdout @stderr = stderr @thread = thread.value end |
Instance Method Details
#result ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/vito/connection.rb', line 40 def result if success? @stdout.read else @stderr.read end end |
#success? ⇒ Boolean
36 37 38 |
# File 'lib/vito/connection.rb', line 36 def success? @thread.exitstatus == 0 end |