Class: Remi::DataTarget::SftpFile
- Inherits:
-
Remi::DataSubject
- Object
- Remi::DataSubject
- Remi::DataTarget::SftpFile
- Includes:
- Remi::DataSubject::DataTarget
- Defined in:
- lib/remi/data_subject/sftp_file.rb
Instance Attribute Summary collapse
-
#local_path ⇒ Object
readonly
Returns the value of attribute local_path.
-
#remote_path ⇒ Object
readonly
Returns the value of attribute remote_path.
Attributes inherited from Remi::DataSubject
Instance Method Summary collapse
-
#initialize(*args, **kargs, &block) ⇒ SftpFile
constructor
A new instance of SftpFile.
-
#load! ⇒ Object
Public: Performs the load operation, regardless of whether it has already executed.
Methods included from Remi::DataSubject::DataTarget
Methods inherited from Remi::DataSubject
Constructor Details
#initialize(*args, **kargs, &block) ⇒ SftpFile
Returns a new instance of SftpFile.
6 7 8 9 |
# File 'lib/remi/data_subject/sftp_file.rb', line 6 def initialize(*args, **kargs, &block) super init_sftp_file(*args, **kargs, &block) end |
Instance Attribute Details
#local_path ⇒ Object (readonly)
Returns the value of attribute local_path.
11 12 13 |
# File 'lib/remi/data_subject/sftp_file.rb', line 11 def local_path @local_path end |
#remote_path ⇒ Object (readonly)
Returns the value of attribute remote_path.
12 13 14 |
# File 'lib/remi/data_subject/sftp_file.rb', line 12 def remote_path @remote_path end |
Instance Method Details
#load! ⇒ Object
Public: Performs the load operation, regardless of whether it has already executed.
Returns true if the load operation was successful
18 19 20 21 22 23 24 25 |
# File 'lib/remi/data_subject/sftp_file.rb', line 18 def load! @logger.info "Uploading #{@local_path} to #{@credentials[:username]}@#{@credentials[:host]}: #{@remote_path}" connection do |sftp| retry_upload { sftp.upload! @local_path, @remote_path } end true end |