Class: RestFtpDaemon::Remote

Inherits:
Object
  • Object
show all
Includes:
LoggerHelper
Defined in:
lib/rest-ftp-daemon/remote.rb

Overview

Handles transfers for Job class

Direct Known Subclasses

RemoteFTP, RemoteSFTP

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, log_context, options = {}) ⇒ Remote

Returns a new instance of Remote.



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/rest-ftp-daemon/remote.rb', line 9

def initialize url, log_context, options = {}
  # Logger
  @log_context = log_context || {}
  @logger = RestFtpDaemon::LoggerPool.instance.get :jobs

  # Extract URL parts
  @url = url
  @url.user ||= "anonymous"

  # Annnounce object
  log_info "Remote.initialize [#{url}]"
end

Instance Attribute Details

#log_contextObject (readonly)

Returns the value of attribute log_context.



7
8
9
# File 'lib/rest-ftp-daemon/remote.rb', line 7

def log_context
  @log_context
end

#loggerObject (readonly)

Returns the value of attribute logger.



6
7
8
# File 'lib/rest-ftp-daemon/remote.rb', line 6

def logger
  @logger
end

Instance Method Details

#closeObject



27
28
29
30
# File 'lib/rest-ftp-daemon/remote.rb', line 27

def close
  # Debug mode ?
  puts "-------------------- SESSION CLOSING --------------------------" if @debug
end

#connectObject



22
23
24
25
# File 'lib/rest-ftp-daemon/remote.rb', line 22

def connect
  # Debug mode ?
  debug_header if @debug
end