Class: BigBackup::Uploader::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/big_backup/uploader/base.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Base

Returns a new instance of Base.



6
7
8
# File 'lib/big_backup/uploader/base.rb', line 6

def initialize(config)
  @config = config
end

Class Method Details

.build(type, config) ⇒ Object



10
11
12
# File 'lib/big_backup/uploader/base.rb', line 10

def self.build(type, config)
  "BigBackup::Uploader::#{type.to_s.classify}".constantize.new(config)
end

Instance Method Details

#uploader_configObject



14
15
16
17
18
19
20
# File 'lib/big_backup/uploader/base.rb', line 14

def uploader_config
  if File.exists?(BigBackup.config_path)
    @backup_config ||= YAML.load_file(BigBackup.config_path)['backup_server']
  else
    @backup_config ||= YAML.load_file("#{File.dirname(__FILE__)}/../../../config/bigbackup.yml")['backup_server']
  end
end