Class: Backup::Storage::FTP

Inherits:
Base
  • Object
show all
Includes:
Cycler
Defined in:
lib/backup/storage/ftp.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#keep, #model, #package, #path, #storage_id

Instance Method Summary collapse

Methods inherited from Base

#perform!

Methods included from Config::Helpers

included

Constructor Details

#initialize(model, storage_id = nil) ⇒ FTP

Returns a new instance of FTP.



29
30
31
32
33
34
35
36
37
# File 'lib/backup/storage/ftp.rb', line 29

def initialize(model, storage_id = nil)
  super

  @port         ||= 21
  @path         ||= "backups"
  @passive_mode ||= false
  @timeout      ||= nil
  path.sub!(/^~\//, "")
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Backup::Config::Helpers

Instance Attribute Details

#ipObject

Server IP Address and FTP port



14
15
16
# File 'lib/backup/storage/ftp.rb', line 14

def ip
  @ip
end

#passive_modeObject

Use passive mode?



18
19
20
# File 'lib/backup/storage/ftp.rb', line 18

def passive_mode
  @passive_mode
end

#passwordObject

Server credentials



10
11
12
# File 'lib/backup/storage/ftp.rb', line 10

def password
  @password
end

#portObject

Server IP Address and FTP port



14
15
16
# File 'lib/backup/storage/ftp.rb', line 14

def port
  @port
end

#timeoutInteger|Float

Parameters:

  • (Integer|Float)

Returns:

  • (Integer|Float)


27
28
29
# File 'lib/backup/storage/ftp.rb', line 27

def timeout
  @timeout
end

#usernameObject

Server credentials



10
11
12
# File 'lib/backup/storage/ftp.rb', line 10

def username
  @username
end