Class: Logcli::Actions::Download
- Inherits:
-
Object
- Object
- Logcli::Actions::Download
- Defined in:
- lib/logcli/actions/download.rb
Instance Attribute Summary collapse
-
#local_path ⇒ Object
Returns the value of attribute local_path.
-
#remote_path ⇒ Object
Returns the value of attribute remote_path.
Instance Method Summary collapse
- #call(scp) ⇒ Object
-
#initialize(opts) ⇒ Download
constructor
A new instance of Download.
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_path ⇒ Object
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_path ⇒ Object
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 |