Class: Proxy::RemoteExecution::Ssh::CommandUpdate
- Inherits:
-
Object
- Object
- Proxy::RemoteExecution::Ssh::CommandUpdate
- Defined in:
- lib/smart_proxy_remote_execution_ssh/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.
6 7 8 9 |
# File 'lib/smart_proxy_remote_execution_ssh/command_update.rb', line 6 def initialize(buffer) @buffer = buffer extract_exit_status end |
Instance Attribute Details
#buffer ⇒ Object (readonly)
Returns the value of attribute buffer.
4 5 6 |
# File 'lib/smart_proxy_remote_execution_ssh/command_update.rb', line 4 def buffer @buffer end |
#exit_status ⇒ Object (readonly)
Returns the value of attribute exit_status.
4 5 6 |
# File 'lib/smart_proxy_remote_execution_ssh/command_update.rb', line 4 def exit_status @exit_status end |
Class Method Details
.encode_exception(description, exception, fatal = true) ⇒ Object
24 25 26 27 28 |
# File 'lib/smart_proxy_remote_execution_ssh/command_update.rb', line 24 def self.encode_exception(description, exception, fatal = true) ret = [DebugData.new("#{description}\n#{exception.class} #{exception.message}")] ret << StatusData.new('EXCEPTION') if fatal return ret end |
Instance Method Details
#buffer_to_hash ⇒ Object
20 21 22 |
# File 'lib/smart_proxy_remote_execution_ssh/command_update.rb', line 20 def buffer_to_hash buffer.map(&:to_hash) end |
#extract_exit_status ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/smart_proxy_remote_execution_ssh/command_update.rb', line 11 def extract_exit_status @buffer.delete_if do |data| if data.is_a? StatusData @exit_status = data.data true end end end |