Class: Capistrano::Transfer::SFTPTransferWrapper
- Inherits:
-
Object
- Object
- Capistrano::Transfer::SFTPTransferWrapper
- Defined in:
- lib/capistrano/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.
154 155 156 157 158 |
# File 'lib/capistrano/transfer.rb', line 154 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.
152 153 154 |
# File 'lib/capistrano/transfer.rb', line 152 def operation @operation end |
Instance Method Details
#[](key) ⇒ Object
164 165 166 |
# File 'lib/capistrano/transfer.rb', line 164 def [](key) @operation[key] end |
#[]=(key, value) ⇒ Object
168 169 170 |
# File 'lib/capistrano/transfer.rb', line 168 def []=(key, value) @operation[key] = value end |
#abort! ⇒ Object
172 173 174 |
# File 'lib/capistrano/transfer.rb', line 172 def abort! @operation.abort! end |
#active? ⇒ Boolean
160 161 162 |
# File 'lib/capistrano/transfer.rb', line 160 def active? @operation.nil? || @operation.active? end |