Class: Backup::Database::Base
- Inherits:
-
Object
- Object
- Backup::Database::Base
- Includes:
- Config::Helpers, Utilities::Helpers
- Defined in:
- lib/backup/database/base.rb
Instance Attribute Summary collapse
-
#database_id ⇒ Object
readonly
Returns the value of attribute database_id.
-
#dump_path ⇒ Object
readonly
Returns the value of attribute dump_path.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
-
#initialize(model, database_id = nil) ⇒ Base
constructor
If given,
database_id
will be appended to the #dump_filename. - #perform! ⇒ Object
Methods included from Config::Helpers
Constructor Details
#initialize(model, database_id = nil) ⇒ Base
If given, database_id
will be appended to the #dump_filename. This is required if multiple Databases of the same class are added to the model.
17 18 19 20 21 22 |
# File 'lib/backup/database/base.rb', line 17 def initialize(model, database_id = nil) @model = model @database_id = database_id.to_s.gsub(/\W/, '_') if database_id @dump_path = File.join(Config.tmp_path, model.trigger, 'databases') load_defaults! end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Backup::Config::Helpers
Instance Attribute Details
#database_id ⇒ Object (readonly)
Returns the value of attribute database_id.
11 12 13 |
# File 'lib/backup/database/base.rb', line 11 def database_id @database_id end |
#dump_path ⇒ Object (readonly)
Returns the value of attribute dump_path.
11 12 13 |
# File 'lib/backup/database/base.rb', line 11 def dump_path @dump_path end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
11 12 13 |
# File 'lib/backup/database/base.rb', line 11 def model @model end |
Instance Method Details
#perform! ⇒ Object
24 25 26 27 |
# File 'lib/backup/database/base.rb', line 24 def perform! log!(:started) prepare! end |