Class: Logcli::Actions::Download

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ Download



5
6
7
8
# File 'lib/logcli/actions/download.rb', line 5

def initialize opts
  @remote_path = opts.fetch(:remote_path)
  @local_path = opts.fetch(:local_path)
end

Instance Attribute Details

#local_pathObject

Returns the value of attribute local_path.



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

def local_path
  @local_path
end

#remote_pathObject

Returns the value of attribute remote_path.



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

def remote_path
  @remote_path
end

Instance Method Details

#call(scp) ⇒ Object



10
11
12
13
# File 'lib/logcli/actions/download.rb', line 10

def call scp
  generate_local_path
  scp.download(remote_path, (local_path || generate_local_path))
end