class Logcli::Actions::Download
Attributes
local_path[RW]
remote_path[RW]
Public Class Methods
new(opts)
click to toggle source
# File lib/logcli/actions/download.rb, line 5 def initialize opts @remote_path = opts.fetch(:remote_path) @local_path = opts.fetch(:local_path) end
Public Instance Methods
call(scp)
click to toggle source
# File lib/logcli/actions/download.rb, line 10 def call scp generate_local_path scp.download(remote_path, (local_path || generate_local_path)) end
Private Instance Methods
generate_local_path()
click to toggle source
# File lib/logcli/actions/download.rb, line 17 def generate_local_path File.join Dir.pwd, File.basename(remote_path) end