Class: Bard::BackupConfig
- Inherits:
-
Object
- Object
- Bard::BackupConfig
- Defined in:
- lib/bard/config.rb
Instance Attribute Summary collapse
-
#bard_enabled ⇒ Object
readonly
Returns the value of attribute bard_enabled.
-
#destinations ⇒ Object
readonly
Returns the value of attribute destinations.
Instance Method Summary collapse
- #bard ⇒ Object
- #bard? ⇒ Boolean
-
#initialize(&block) ⇒ BackupConfig
constructor
A new instance of BackupConfig.
- #s3(name, credentials:, path:) ⇒ Object
- #self_managed? ⇒ Boolean
Constructor Details
#initialize(&block) ⇒ BackupConfig
Returns a new instance of BackupConfig.
111 112 113 114 115 |
# File 'lib/bard/config.rb', line 111 def initialize(&block) @bard_enabled = false @destinations = [] instance_eval(&block) if block_given? end |
Instance Attribute Details
#bard_enabled ⇒ Object (readonly)
Returns the value of attribute bard_enabled.
109 110 111 |
# File 'lib/bard/config.rb', line 109 def @bard_enabled end |
#destinations ⇒ Object (readonly)
Returns the value of attribute destinations.
109 110 111 |
# File 'lib/bard/config.rb', line 109 def destinations @destinations end |
Instance Method Details
#bard ⇒ Object
117 118 119 |
# File 'lib/bard/config.rb', line 117 def @bard_enabled = true end |
#bard? ⇒ Boolean
130 131 132 |
# File 'lib/bard/config.rb', line 130 def @bard_enabled end |
#s3(name, credentials:, path:) ⇒ Object
121 122 123 124 125 126 127 128 |
# File 'lib/bard/config.rb', line 121 def s3(name, credentials:, path:) @destinations << { name: name, type: :s3, credentials: credentials, path: path } end |
#self_managed? ⇒ Boolean
134 135 136 |
# File 'lib/bard/config.rb', line 134 def self_managed? @destinations.any? end |