Class: FileTransfer::Sftp
Instance Attribute Summary
Attributes inherited from Generic
#host, #password, #port, #username
Instance Method Summary collapse
- #download(from_path, to_path) ⇒ Object
-
#initialize(options = {}) ⇒ Sftp
constructor
A new instance of Sftp.
- #upload(from_path, to_path) ⇒ Object
Methods inherited from Generic
Constructor Details
#initialize(options = {}) ⇒ Sftp
Returns a new instance of Sftp.
5 6 7 8 9 |
# File 'lib/file_transfer/sftp.rb', line 5 def initialize( = {}) [:port] ||= 22 super() connect end |
Instance Method Details
#download(from_path, to_path) ⇒ Object
11 12 13 |
# File 'lib/file_transfer/sftp.rb', line 11 def download(from_path, to_path) @sftp.download! from_path, to_path end |
#upload(from_path, to_path) ⇒ Object
15 16 17 |
# File 'lib/file_transfer/sftp.rb', line 15 def upload(from_path, to_path) @sftp.upload! from_path, to_path end |