Class: Logcli::SSH
- Inherits:
-
Object
- Object
- Logcli::SSH
- Defined in:
- lib/logcli/ssh.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
Instance Method Summary collapse
- #execute!(command) ⇒ Object
-
#initialize(params) ⇒ SSH
constructor
A new instance of SSH.
Constructor Details
#initialize(params) ⇒ SSH
4 5 6 |
# File 'lib/logcli/ssh.rb', line 4 def initialize params @params = params end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
3 4 5 |
# File 'lib/logcli/ssh.rb', line 3 def params @params end |
Instance Method Details
#execute!(command) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/logcli/ssh.rb', line 8 def execute! command result = '' Net::SSH.start(*params.ssh_args) do |ssh| result = ssh.exec! command end result end |