Class: Bard::BackupConfig
- Inherits:
-
Object
- Object
- Bard::BackupConfig
- Defined in:
- lib/bard/config.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.
110 111 112 113 |
# File 'lib/bard/config.rb', line 110 def initialize(&block) @destinations = [] instance_eval(&block) if block_given? end |
Instance Attribute Details
#destinations ⇒ Object (readonly)
Returns the value of attribute destinations.
108 109 110 |
# File 'lib/bard/config.rb', line 108 def destinations @destinations end |
Instance Method Details
#bard ⇒ Object
115 116 117 |
# File 'lib/bard/config.rb', line 115 def @bard = true end |
#bard? ⇒ Boolean
119 120 121 |
# File 'lib/bard/config.rb', line 119 def !!@bard end |
#disabled ⇒ Object
123 124 125 |
# File 'lib/bard/config.rb', line 123 def disabled @disabled = true end |
#disabled? ⇒ Boolean
127 128 129 |
# File 'lib/bard/config.rb', line 127 def disabled? !!@disabled end |
#enabled? ⇒ Boolean
131 132 133 |
# File 'lib/bard/config.rb', line 131 def enabled? !disabled? end |
#s3(name, **kwargs) ⇒ Object
135 136 137 138 139 140 141 |
# File 'lib/bard/config.rb', line 135 def s3(name, **kwargs) @destinations << { name: name, type: :s3, **kwargs, } end |
#self_managed? ⇒ Boolean
143 144 145 |
# File 'lib/bard/config.rb', line 143 def self_managed? @destinations.any? end |