Class: Proxy::RemoteExecution::Ssh::Dispatcher::Command
- Inherits:
-
Object
- Object
- Proxy::RemoteExecution::Ssh::Dispatcher::Command
- Defined in:
- lib/smart_proxy_remote_execution_ssh/dispatcher.rb
Overview
command comming from action
Instance Attribute Summary collapse
-
#effective_user ⇒ Object
readonly
Returns the value of attribute effective_user.
-
#effective_user_method ⇒ Object
readonly
Returns the value of attribute effective_user_method.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#host_public_key ⇒ Object
readonly
Returns the value of attribute host_public_key.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#script ⇒ Object
readonly
Returns the value of attribute script.
-
#ssh_user ⇒ Object
readonly
Returns the value of attribute ssh_user.
-
#suspended_action ⇒ Object
readonly
Returns the value of attribute suspended_action.
Instance Method Summary collapse
-
#initialize(data) ⇒ Command
constructor
A new instance of Command.
- #validate!(data) ⇒ Object
Constructor Details
#initialize(data) ⇒ Command
Returns a new instance of Command.
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/smart_proxy_remote_execution_ssh/dispatcher.rb', line 12 def initialize(data) validate!(data) @id = data[:id] @host = data[:host] @ssh_user = data[:ssh_user] @effective_user = data[:effective_user] @effective_user_method = data[:effective_user_method] || 'su' @script = data[:script] @host_public_key = data[:host_public_key] @suspended_action = data[:suspended_action] end |
Instance Attribute Details
#effective_user ⇒ Object (readonly)
Returns the value of attribute effective_user.
10 11 12 |
# File 'lib/smart_proxy_remote_execution_ssh/dispatcher.rb', line 10 def effective_user @effective_user end |
#effective_user_method ⇒ Object (readonly)
Returns the value of attribute effective_user_method.
10 11 12 |
# File 'lib/smart_proxy_remote_execution_ssh/dispatcher.rb', line 10 def effective_user_method @effective_user_method end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
10 11 12 |
# File 'lib/smart_proxy_remote_execution_ssh/dispatcher.rb', line 10 def host @host end |
#host_public_key ⇒ Object (readonly)
Returns the value of attribute host_public_key.
10 11 12 |
# File 'lib/smart_proxy_remote_execution_ssh/dispatcher.rb', line 10 def host_public_key @host_public_key end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
10 11 12 |
# File 'lib/smart_proxy_remote_execution_ssh/dispatcher.rb', line 10 def id @id end |
#script ⇒ Object (readonly)
Returns the value of attribute script.
10 11 12 |
# File 'lib/smart_proxy_remote_execution_ssh/dispatcher.rb', line 10 def script @script end |
#ssh_user ⇒ Object (readonly)
Returns the value of attribute ssh_user.
10 11 12 |
# File 'lib/smart_proxy_remote_execution_ssh/dispatcher.rb', line 10 def ssh_user @ssh_user end |
#suspended_action ⇒ Object (readonly)
Returns the value of attribute suspended_action.
10 11 12 |
# File 'lib/smart_proxy_remote_execution_ssh/dispatcher.rb', line 10 def suspended_action @suspended_action end |
Instance Method Details
#validate!(data) ⇒ Object
25 26 27 28 29 |
# File 'lib/smart_proxy_remote_execution_ssh/dispatcher.rb', line 25 def validate!(data) required_fields = [:id, :host, :ssh_user, :script, :suspended_action] missing_fields = required_fields.find_all { |f| !data[f] } raise ArgumentError, "Missing fields: #{missing_fields}" unless missing_fields.empty? end |