Class: Backup::Database::Base

Inherits:
Object
  • Object
show all
Includes:
CLI::Helpers, Configuration::Helpers
Defined in:
lib/backup/database/base.rb

Direct Known Subclasses

MongoDB, MySQL, PostgreSQL, Redis, Riak

Constant Summary

Constants included from CLI::Helpers

CLI::Helpers::UTILITY

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Configuration::Helpers

#clear_defaults!, #load_defaults!

Methods included from CLI::Helpers

#command_name, #raise_if_command_failed!, #run, #utility

Constructor Details

#initialize(model) ⇒ Base

Creates a new instance of the MongoDB database object

  • Called using super(model) from subclasses *



18
19
20
21
# File 'lib/backup/database/base.rb', line 18

def initialize(model)
  @model = model
  load_defaults!
end

Instance Attribute Details

#utility_pathObject

Allows the user to specify the path to a “dump” utility in case it cannot be auto-detected by Backup

DEPRECATED
  • use each subclass’ <utility_name>_utility method



13
14
15
# File 'lib/backup/database/base.rb', line 13

def utility_path
  @utility_path
end

Instance Method Details

#perform!Object

Super method for all child (database) objects. Every database object’s #perform! method should call #super before anything else to prepare



26
27
28
29
# File 'lib/backup/database/base.rb', line 26

def perform!
  prepare!
  log!
end