Class: DbBackup
- Inherits:
-
Object
- Object
- DbBackup
- Extended by:
- Forwardable
- Defined in:
- lib/db_backups/db_backup.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
Instance Method Summary collapse
- #environment ⇒ Object
-
#initialize(cloud_file, opts = {}) ⇒ DbBackup
constructor
A new instance of DbBackup.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(cloud_file, opts = {}) ⇒ DbBackup
Returns a new instance of DbBackup.
10 11 12 13 |
# File 'lib/db_backups/db_backup.rb', line 10 def initialize(cloud_file, opts={}) @cloud_file = cloud_file @app = opts[:app] end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
6 7 8 |
# File 'lib/db_backups/db_backup.rb', line 6 def app @app end |
Instance Method Details
#environment ⇒ Object
15 16 17 |
# File 'lib/db_backups/db_backup.rb', line 15 def environment @environment ||= @cloud_file.key.split("/")[1] end |
#inspect ⇒ Object
23 24 25 |
# File 'lib/db_backups/db_backup.rb', line 23 def inspect "<##{self.class.name} #{to_s.inspect} size=#{content_length}>" end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/db_backups/db_backup.rb', line 19 def to_s "#{app}.#{environment}.#{last_modified.strftime('%Y%m%d%H%M%S')}.sql" end |