Class: ODisk::Copier

Inherits:
Opee::Actor
  • Object
show all
Defined in:
lib/odisk/copier.rb

Overview

Provides upload and download functionality using sftp and ssh on a single connection.

Instance Method Summary (collapse)

Constructor Details

- (Copier) initialize(options = {})

Returns a new instance of Copier



13
14
15
16
17
18
# File 'lib/odisk/copier.rb', line 13

def initialize(options={})
  @ftp = nil
  @ssh = nil
  super(options)
  @copy_queue.ask(:ready, self)
end

Instance Method Details

- (Object) close



27
28
29
30
31
32
# File 'lib/odisk/copier.rb', line 27

def close()
  @ftp.close_channel() unless @ftp.nil?
  @ftp = nil
  @ssh.close() unless @ssh.nil?
  super()
end

- (Object) set_options(options)



20
21
22
23
24
25
# File 'lib/odisk/copier.rb', line 20

def set_options(options)
  super(options)
  @copy_queue = options[:copy_queue]
  @crypt_queue = options[:crypt_queue]
  @fixer = options[:fixer]
end