Class: Capissh::Transfer::SFTPTransferWrapper
- Inherits:
-
Object
- Object
- Capissh::Transfer::SFTPTransferWrapper
- Defined in:
- lib/capissh/transfer.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.
141 142 143 144 145 |
# File 'lib/capissh/transfer.rb', line 141 def initialize(session, &callback) session.sftp(false).connect do |sftp| @operation = callback.call(sftp) end end |
Instance Attribute Details
#operation ⇒ Object (readonly)
Returns the value of attribute operation.
139 140 141 |
# File 'lib/capissh/transfer.rb', line 139 def operation @operation end |
Instance Method Details
#[](key) ⇒ Object
151 152 153 |
# File 'lib/capissh/transfer.rb', line 151 def [](key) @operation[key] end |
#[]=(key, value) ⇒ Object
155 156 157 |
# File 'lib/capissh/transfer.rb', line 155 def []=(key, value) @operation[key] = value end |
#abort! ⇒ Object
159 160 161 |
# File 'lib/capissh/transfer.rb', line 159 def abort! @operation.abort! end |
#active? ⇒ Boolean
147 148 149 |
# File 'lib/capissh/transfer.rb', line 147 def active? @operation.nil? || @operation.active? end |