Class: BigBackup::Database::Base

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

Direct Known Subclasses

Mongodb, Mysql

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Base

Returns a new instance of Base.



5
6
7
# File 'lib/big_backup/databases/base.rb', line 5

def initialize(config)
  @config = config
end

Class Method Details

.build(type, config) ⇒ Object



9
10
11
# File 'lib/big_backup/databases/base.rb', line 9

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

Instance Method Details

#build_cmd(timestamp) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/big_backup/databases/base.rb', line 29

def build_cmd(timestamp)
  str = String.new
  @config.each do |database, config|
    str << " && " unless str.empty?
    str << self.cmd_line(database, config, timestamp)
  end
  str;
end