Class: Backup::Storage::Local

Inherits:
Base
  • Object
show all
Defined in:
lib/backup/storage/local.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#keep, #storage_id

Instance Method Summary collapse

Methods inherited from Base

#perform!

Methods included from Configuration::Helpers

included

Constructor Details

#initialize(model, storage_id = nil, &block) ⇒ Local

Creates a new instance of the storage object



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/backup/storage/local.rb', line 13

def initialize(model, storage_id = nil, &block)
  super(model, storage_id)

  @path ||= File.join(
    File.expand_path(ENV['HOME'] || ''),
    'backups'
  )

  instance_eval(&block) if block_given?

  @path = File.expand_path(@path)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Backup::Configuration::Helpers

Instance Attribute Details

#pathObject

Path where the backup will be stored.



9
10
11
# File 'lib/backup/storage/local.rb', line 9

def path
  @path
end