Class: Bard::BackupConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/bard/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ BackupConfig

Returns a new instance of BackupConfig.



187
188
189
190
# File 'lib/bard/config.rb', line 187

def initialize(&block)
  @destinations = []
  instance_eval(&block) if block_given?
end

Instance Attribute Details

#destinationsObject (readonly)

Returns the value of attribute destinations.



185
186
187
# File 'lib/bard/config.rb', line 185

def destinations
  @destinations
end

Instance Method Details

#bardObject



192
193
194
# File 'lib/bard/config.rb', line 192

def bard
  @bard = true
end

#bard?Boolean

Returns:

  • (Boolean)


196
197
198
# File 'lib/bard/config.rb', line 196

def bard?
  !!@bard
end

#disabledObject



200
201
202
# File 'lib/bard/config.rb', line 200

def disabled
  @disabled = true
end

#disabled?Boolean

Returns:

  • (Boolean)


204
205
206
# File 'lib/bard/config.rb', line 204

def disabled?
  !!@disabled
end

#enabled?Boolean

Returns:

  • (Boolean)


208
209
210
# File 'lib/bard/config.rb', line 208

def enabled?
  !disabled?
end

#s3(name, **kwargs) ⇒ Object



212
213
214
215
216
217
218
# File 'lib/bard/config.rb', line 212

def s3(name, **kwargs)
  @destinations << {
    name: name,
    type: :s3,
    **kwargs,
  }
end

#self_managed?Boolean

Returns:

  • (Boolean)


220
221
222
# File 'lib/bard/config.rb', line 220

def self_managed?
  @destinations.any?
end