Class: Backup::Package
- Inherits:
-
Object
- Object
- Backup::Package
- Defined in:
- lib/backup/package.rb
Instance Attribute Summary collapse
-
#chunk_suffixes ⇒ Object
Set by the Splitter if the final archive was “chunked”.
-
#extension ⇒ Object
Extension for the final archive file(s).
-
#time ⇒ Object
readonly
The time when the backup initiated (in format: 2011.02.20.03.29.59).
-
#trigger ⇒ Object
readonly
The trigger which initiated the backup process.
-
#version ⇒ Object
readonly
The version of Backup used to create the package.
Instance Method Summary collapse
- #basename ⇒ Object
- #filenames ⇒ Object
-
#initialize(model) ⇒ Package
constructor
A new instance of Package.
Constructor Details
Instance Attribute Details
#chunk_suffixes ⇒ Object
Set by the Splitter if the final archive was “chunked”
20 21 22 |
# File 'lib/backup/package.rb', line 20 def chunk_suffixes @chunk_suffixes end |
#extension ⇒ Object
Extension for the final archive file(s)
16 17 18 |
# File 'lib/backup/package.rb', line 16 def extension @extension end |
#time ⇒ Object (readonly)
The time when the backup initiated (in format: 2011.02.20.03.29.59)
8 9 10 |
# File 'lib/backup/package.rb', line 8 def time @time end |
#trigger ⇒ Object (readonly)
The trigger which initiated the backup process
12 13 14 |
# File 'lib/backup/package.rb', line 12 def trigger @trigger end |
#version ⇒ Object (readonly)
The version of Backup used to create the package
24 25 26 |
# File 'lib/backup/package.rb', line 24 def version @version end |
Instance Method Details
#basename ⇒ Object
42 43 44 |
# File 'lib/backup/package.rb', line 42 def basename "#{ time }.#{ trigger }.#{ extension }" end |
#filenames ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/backup/package.rb', line 34 def filenames if chunk_suffixes.empty? [basename] else chunk_suffixes.map {|suffix| "#{ basename }-#{ suffix }" } end end |