Class: Logcli::SSH

Inherits:
Object
  • Object
show all
Defined in:
lib/logcli/ssh.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ SSH



4
5
6
# File 'lib/logcli/ssh.rb', line 4

def initialize params
  @params = params
end

Instance Attribute Details

#paramsObject

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