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.
175 176 177 178 |
# File 'lib/bard/config.rb', line 175 def initialize(&block) @destinations = [] instance_eval(&block) if block_given? end |
Instance Attribute Details
#destinations ⇒ Object (readonly)
Returns the value of attribute destinations.
173 174 175 |
# File 'lib/bard/config.rb', line 173 def destinations @destinations end |
Instance Method Details
#bard ⇒ Object
180 181 182 |
# File 'lib/bard/config.rb', line 180 def @bard = true end |
#bard? ⇒ Boolean
184 185 186 |
# File 'lib/bard/config.rb', line 184 def !!@bard end |
#disabled ⇒ Object
188 189 190 |
# File 'lib/bard/config.rb', line 188 def disabled @disabled = true end |
#disabled? ⇒ Boolean
192 193 194 |
# File 'lib/bard/config.rb', line 192 def disabled? !!@disabled end |
#enabled? ⇒ Boolean
196 197 198 |
# File 'lib/bard/config.rb', line 196 def enabled? !disabled? end |
#s3(name, **kwargs) ⇒ Object
200 201 202 203 204 205 206 |
# File 'lib/bard/config.rb', line 200 def s3(name, **kwargs) @destinations << { name: name, type: :s3, **kwargs, } end |
#self_managed? ⇒ Boolean
208 209 210 |
# File 'lib/bard/config.rb', line 208 def self_managed? @destinations.any? end |