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).
-
#no_cycle ⇒ Object
If true, the Cycler will not attempt to remove the package when Cycling.
-
#time ⇒ Object
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.
- #time_as_object ⇒ Object
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 |
#no_cycle ⇒ Object
If true, the Cycler will not attempt to remove the package when Cycling.
24 25 26 |
# File 'lib/backup/package.rb', line 24 def no_cycle @no_cycle end |
#time ⇒ Object
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
28 29 30 |
# File 'lib/backup/package.rb', line 28 def version @version end |
Instance Method Details
#basename ⇒ Object
46 47 48 |
# File 'lib/backup/package.rb', line 46 def basename "#{ trigger }.#{ extension }" end |
#filenames ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/backup/package.rb', line 38 def filenames if chunk_suffixes.empty? [basename] else chunk_suffixes.map {|suffix| "#{ basename }-#{ suffix }" } end end |
#time_as_object ⇒ Object
50 51 52 |
# File 'lib/backup/package.rb', line 50 def time_as_object Time.strptime(time, '%Y.%m.%d.%H.%M.%S') end |