Class: BigBackup::Uploader::Base
- Inherits:
-
Object
- Object
- BigBackup::Uploader::Base
- Defined in:
- lib/big_backup/uploader/base.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(config) ⇒ Base
constructor
A new instance of Base.
- #uploader_config ⇒ Object
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_config ⇒ Object
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 |