Class: Proxy::RemoteExecution::Ssh::CommandUpdate
- Inherits:
-
Object
- Object
- Proxy::RemoteExecution::Ssh::CommandUpdate
- Defined in:
- lib/smart_proxy_remote_execution_ssh_core/command_update.rb
Overview
update sent back to the suspended action
Defined Under Namespace
Classes: Data, DebugData, StatusData, StderrData, StdoutData
Instance Attribute Summary collapse
-
#buffer ⇒ Object
readonly
Returns the value of attribute buffer.
-
#exit_status ⇒ Object
readonly
Returns the value of attribute exit_status.
Class Method Summary collapse
Instance Method Summary collapse
- #buffer_to_hash ⇒ Object
- #extract_exit_status ⇒ Object
-
#initialize(buffer) ⇒ CommandUpdate
constructor
A new instance of CommandUpdate.
Constructor Details
#initialize(buffer) ⇒ CommandUpdate
Returns a new instance of CommandUpdate.
8 9 10 11 |
# File 'lib/smart_proxy_remote_execution_ssh_core/command_update.rb', line 8 def initialize(buffer) @buffer = buffer extract_exit_status end |
Instance Attribute Details
#buffer ⇒ Object (readonly)
Returns the value of attribute buffer.
6 7 8 |
# File 'lib/smart_proxy_remote_execution_ssh_core/command_update.rb', line 6 def buffer @buffer end |
#exit_status ⇒ Object (readonly)
Returns the value of attribute exit_status.
6 7 8 |
# File 'lib/smart_proxy_remote_execution_ssh_core/command_update.rb', line 6 def exit_status @exit_status end |
Class Method Details
.encode_exception(description, exception, fatal = true) ⇒ Object
26 27 28 29 30 |
# File 'lib/smart_proxy_remote_execution_ssh_core/command_update.rb', line 26 def self.encode_exception(description, exception, fatal = true) ret = [DebugData.new("#{description}\n#{exception.class} #{exception.}")] ret << StatusData.new('EXCEPTION') if fatal return ret end |
Instance Method Details
#buffer_to_hash ⇒ Object
22 23 24 |
# File 'lib/smart_proxy_remote_execution_ssh_core/command_update.rb', line 22 def buffer_to_hash buffer.map(&:to_hash) end |
#extract_exit_status ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/smart_proxy_remote_execution_ssh_core/command_update.rb', line 13 def extract_exit_status @buffer.delete_if do |data| if data.is_a? StatusData @exit_status = data.data true end end end |