Class: Rigger::TaskExecutor::SFTPTransferWrapper
- Inherits:
-
Object
- Object
- Rigger::TaskExecutor::SFTPTransferWrapper
- Defined in:
- lib/rigger/task_executor.rb
Instance Attribute Summary collapse
-
#operation ⇒ Object
readonly
Returns the value of attribute operation.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #abort! ⇒ Object
- #active? ⇒ Boolean
-
#initialize(session, &callback) ⇒ SFTPTransferWrapper
constructor
A new instance of SFTPTransferWrapper.
Constructor Details
#initialize(session, &callback) ⇒ SFTPTransferWrapper
Returns a new instance of SFTPTransferWrapper.
10 11 12 13 14 |
# File 'lib/rigger/task_executor.rb', line 10 def initialize(session, &callback) @sftp = session.sftp(false).connect do |sftp| @operation = callback.call(sftp) end end |
Instance Attribute Details
#operation ⇒ Object (readonly)
Returns the value of attribute operation.
8 9 10 |
# File 'lib/rigger/task_executor.rb', line 8 def operation @operation end |
Instance Method Details
#[](key) ⇒ Object
20 21 22 |
# File 'lib/rigger/task_executor.rb', line 20 def [](key) @operation[key] end |
#[]=(key, value) ⇒ Object
24 25 26 |
# File 'lib/rigger/task_executor.rb', line 24 def []=(key, value) @operation[key] = value end |
#abort! ⇒ Object
28 29 30 |
# File 'lib/rigger/task_executor.rb', line 28 def abort! @operation.abort! end |
#active? ⇒ Boolean
16 17 18 |
# File 'lib/rigger/task_executor.rb', line 16 def active? @operation.nil? || @operation.active? end |