Class: Bard::BackupConfig
- Inherits:
-
Object
- Object
- Bard::BackupConfig
- Defined in:
- lib/bard/plugins/backup.rb
Instance Attribute Summary collapse
-
#destinations ⇒ Object
readonly
Returns the value of attribute destinations.
Instance Method Summary collapse
- #bard ⇒ Object
- #bard? ⇒ Boolean
- #disabled ⇒ Object
- #disabled? ⇒ Boolean
- #enabled? ⇒ Boolean
-
#initialize(&block) ⇒ BackupConfig
constructor
A new instance of BackupConfig.
- #s3(name, **kwargs) ⇒ Object
- #self_managed? ⇒ Boolean
Constructor Details
#initialize(&block) ⇒ BackupConfig
Returns a new instance of BackupConfig.
7 8 9 10 |
# File 'lib/bard/plugins/backup.rb', line 7 def initialize(&block) @destinations = [] instance_eval(&block) if block_given? end |
Instance Attribute Details
#destinations ⇒ Object (readonly)
Returns the value of attribute destinations.
5 6 7 |
# File 'lib/bard/plugins/backup.rb', line 5 def destinations @destinations end |
Instance Method Details
#bard ⇒ Object
12 13 14 |
# File 'lib/bard/plugins/backup.rb', line 12 def @bard = true end |
#bard? ⇒ Boolean
16 17 18 |
# File 'lib/bard/plugins/backup.rb', line 16 def !!@bard end |
#disabled ⇒ Object
20 21 22 |
# File 'lib/bard/plugins/backup.rb', line 20 def disabled @disabled = true end |
#disabled? ⇒ Boolean
24 25 26 |
# File 'lib/bard/plugins/backup.rb', line 24 def disabled? !!@disabled end |
#enabled? ⇒ Boolean
28 29 30 |
# File 'lib/bard/plugins/backup.rb', line 28 def enabled? !disabled? end |
#s3(name, **kwargs) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/bard/plugins/backup.rb', line 32 def s3(name, **kwargs) @destinations << { name: name, type: :s3, **kwargs, } end |
#self_managed? ⇒ Boolean
40 41 42 |
# File 'lib/bard/plugins/backup.rb', line 40 def self_managed? @destinations.any? end |