Class: Backup::Storage::SFTP

Inherits:
Base
  • Object
show all
Defined in:
lib/backup/storage/sftp.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#keep, #storage_id

Instance Method Summary collapse

Methods inherited from Base

#perform!

Methods included from Configuration::Helpers

included

Constructor Details

#initialize(model, storage_id = nil, &block) ⇒ SFTP

Creates a new instance of the storage object



26
27
28
29
30
31
32
33
34
35
# File 'lib/backup/storage/sftp.rb', line 26

def initialize(model, storage_id = nil, &block)
  super(model, storage_id)

  @port ||= 22
  @path ||= 'backups'

  instance_eval(&block) if block_given?

  @path = path.sub(/^\~\//, '')
end

Dynamic Method Handling

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

Instance Attribute Details

#ipObject

Server IP Address and SFTP port



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

def ip
  @ip
end

#passwordObject

Server credentials



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

def password
  @password
end

#pathObject

Path to store backups to



22
23
24
# File 'lib/backup/storage/sftp.rb', line 22

def path
  @path
end

#portObject

Server IP Address and SFTP port



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

def port
  @port
end

#usernameObject

Server credentials



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

def username
  @username
end