Class: Rigger::TaskExecutor::SFTPTransferWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/rigger/task_executor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#operationObject (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

Returns:

  • (Boolean)


16
17
18
# File 'lib/rigger/task_executor.rb', line 16

def active?
  @operation.nil? || @operation.active?
end