Class: Rustic::Configs::Backup

Inherits:
Object
  • Object
show all
Includes:
HooksExt
Defined in:
lib/rustic/configs/backup.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HooksExt

#after, #before

Constructor Details

#initializeBackup

Returns a new instance of Backup.



8
9
10
11
12
13
# File 'lib/rustic/configs/backup.rb', line 8

def initialize
  @paths = []
  @excluded_paths = []
  @one_fs = false
  @compression_mode = "auto"
end

Instance Attribute Details

#compression_modeObject (readonly)

Returns the value of attribute compression_mode.



6
7
8
# File 'lib/rustic/configs/backup.rb', line 6

def compression_mode
  @compression_mode
end

#excluded_pathsObject (readonly)

Returns the value of attribute excluded_paths.



6
7
8
# File 'lib/rustic/configs/backup.rb', line 6

def excluded_paths
  @excluded_paths
end

#one_fsObject (readonly)

Returns the value of attribute one_fs.



6
7
8
# File 'lib/rustic/configs/backup.rb', line 6

def one_fs
  @one_fs
end

#pathsObject (readonly)

Returns the value of attribute paths.



6
7
8
# File 'lib/rustic/configs/backup.rb', line 6

def paths
  @paths
end

Instance Method Details

#backup(*paths) ⇒ Object

Raises:

  • (ArgumentError)


15
16
17
18
19
# File 'lib/rustic/configs/backup.rb', line 15

def backup(*paths)
  raise ArgumentError if paths.empty?

  @paths = paths
end

#compression(value) ⇒ Object



29
30
31
# File 'lib/rustic/configs/backup.rb', line 29

def compression(value)
  @compression_mode = value
end

#exclude(*paths) ⇒ Object

Raises:

  • (ArgumentError)


21
22
23
24
25
# File 'lib/rustic/configs/backup.rb', line 21

def exclude(*paths)
  raise ArgumentError if paths.empty?

  @excluded_paths = paths
end

#one_fs!Object



27
# File 'lib/rustic/configs/backup.rb', line 27

def one_fs! = @one_fs = true