Class: NexusSW::LXD::Transport::Mixins::Helpers::ExecuteMixin::InteractiveResult
- Inherits:
-
ExecuteResult
- Object
- ExecuteResult
- NexusSW::LXD::Transport::Mixins::Helpers::ExecuteMixin::InteractiveResult
- Defined in:
- lib/nexussw/lxd/transport/mixins/helpers/execute.rb
Instance Attribute Summary collapse
-
#exitstatus ⇒ Object
Returns the value of attribute exitstatus.
-
#stdin ⇒ Object
readonly
Returns the value of attribute stdin.
-
#thread ⇒ Object
readonly
Returns the value of attribute thread.
Attributes inherited from ExecuteResult
Instance Method Summary collapse
- #capture_output(&block) ⇒ Object
- #error! ⇒ Object
-
#initialize(command, options, exitstatus, stdin, thread = nil) ⇒ InteractiveResult
constructor
A new instance of InteractiveResult.
- #send_output(stdout_chunk) ⇒ Object
Methods inherited from ExecuteResult
Constructor Details
#initialize(command, options, exitstatus, stdin, thread = nil) ⇒ InteractiveResult
Returns a new instance of InteractiveResult.
50 51 52 53 54 |
# File 'lib/nexussw/lxd/transport/mixins/helpers/execute.rb', line 50 def initialize(command, , exitstatus, stdin, thread = nil) super(command, , exitstatus) @stdin = stdin @thread = thread end |
Instance Attribute Details
#exitstatus ⇒ Object
Returns the value of attribute exitstatus.
57 58 59 |
# File 'lib/nexussw/lxd/transport/mixins/helpers/execute.rb', line 57 def exitstatus @exitstatus end |
#stdin ⇒ Object (readonly)
Returns the value of attribute stdin.
56 57 58 |
# File 'lib/nexussw/lxd/transport/mixins/helpers/execute.rb', line 56 def stdin @stdin end |
#thread ⇒ Object (readonly)
Returns the value of attribute thread.
56 57 58 |
# File 'lib/nexussw/lxd/transport/mixins/helpers/execute.rb', line 56 def thread @thread end |
Instance Method Details
#capture_output(&block) ⇒ Object
59 60 61 |
# File 'lib/nexussw/lxd/transport/mixins/helpers/execute.rb', line 59 def capture_output(&block) @block = block if block_given? end |
#error! ⇒ Object
68 69 70 71 |
# File 'lib/nexussw/lxd/transport/mixins/helpers/execute.rb', line 68 def error! thread.join if thread.respond_to? :join super end |
#send_output(stdout_chunk) ⇒ Object
63 64 65 66 |
# File 'lib/nexussw/lxd/transport/mixins/helpers/execute.rb', line 63 def send_output(stdout_chunk) return unless @block @block.call stdout_chunk end |