Class: HerokuPgBackupsArchive::Backup
- Inherits:
-
Object
- Object
- HerokuPgBackupsArchive::Backup
- Defined in:
- lib/heroku_pg_backups_archive/backup.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
- #finished_at ⇒ Object
-
#initialize(backup_output) ⇒ Backup
constructor
A new instance of Backup.
- #url ⇒ Object
Constructor Details
#initialize(backup_output) ⇒ Backup
Returns a new instance of Backup.
10 11 12 |
# File 'lib/heroku_pg_backups_archive/backup.rb', line 10 def initialize(backup_output) @id = extract_id(backup_output) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/heroku_pg_backups_archive/backup.rb', line 8 def id @id end |
Class Method Details
.create ⇒ Object
3 4 5 6 |
# File 'lib/heroku_pg_backups_archive/backup.rb', line 3 def self.create backup_output = ToolbeltHelper.capture_backup new(backup_output) end |
Instance Method Details
#finished_at ⇒ Object
18 19 20 21 22 23 |
# File 'lib/heroku_pg_backups_archive/backup.rb', line 18 def finished_at @finished_at ||= begin info = ToolbeltHelper.fetch_backup_info(id) Time.parse(info.match(/Finished:\s*(.*)\n/)[1]) end end |
#url ⇒ Object
14 15 16 |
# File 'lib/heroku_pg_backups_archive/backup.rb', line 14 def url @url ||= ToolbeltHelper.fetch_backup_public_url(id).chomp end |