Class: Backup::Record::Base
- Defined in:
- lib/backup/record/base.rb
Instance Attribute Summary collapse
-
#adapter_config ⇒ Object
Attributes.
-
#keep_backups ⇒ Object
Attributes.
Class Method Summary collapse
-
.destroy_all_backups(procedure, trigger) ⇒ Object
Destroys all backups for the specified trigger from Remote Server (FTP).
Instance Method Summary collapse
-
#load_adapter(adapter) ⇒ Object
Receives the options hash and stores it.
Instance Attribute Details
#adapter_config ⇒ Object
Attributes
17 18 19 |
# File 'lib/backup/record/base.rb', line 17 def adapter_config @adapter_config end |
#keep_backups ⇒ Object
Attributes
17 18 19 |
# File 'lib/backup/record/base.rb', line 17 def keep_backups @keep_backups end |
Class Method Details
.destroy_all_backups(procedure, trigger) ⇒ Object
Destroys all backups for the specified trigger from Remote Server (FTP)
32 33 34 35 36 37 38 39 40 |
# File 'lib/backup/record/base.rb', line 32 def self.destroy_all_backups(procedure, trigger) backups = self.all(:conditions => {:trigger => trigger}) unless backups.empty? # Derived classes must implement this method! self.destroy_backups(procedure, backups) puts "\nAll \"#{procedure.trigger}\" backups destroyed.\n\n" end end |
Instance Method Details
#load_adapter(adapter) ⇒ Object
Receives the options hash and stores it
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/backup/record/base.rb', line 20 def load_adapter(adapter) self.adapter_config = adapter self.trigger = adapter.procedure.trigger self.adapter = adapter.procedure.adapter_name.to_s self.filename = adapter.final_file self.keep_backups = adapter.procedure.attributes['keep_backups'] # TODO calculate md5sum of file load_specific_settings(adapter) if respond_to?(:load_specific_settings) end |