Class: Rustic::Configs::Forget

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HooksExt

#after, #before

Constructor Details

#initializeForget

Returns a new instance of Forget.



8
9
10
# File 'lib/rustic/configs/forget.rb', line 8

def initialize
  @prune = false
end

Instance Attribute Details

#keep_lastObject (readonly)

Returns the value of attribute keep_last.



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

def keep_last
  @keep_last
end

#keep_monthlyObject (readonly)

Returns the value of attribute keep_monthly.



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

def keep_monthly
  @keep_monthly
end

#keep_weeklyObject (readonly)

Returns the value of attribute keep_weekly.



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

def keep_weekly
  @keep_weekly
end

#pruneObject (readonly)

Returns the value of attribute prune.



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

def prune
  @prune
end

Instance Method Details

#keep(last: nil, weekly: nil, monthly: nil) ⇒ Object

Raises:

  • (ArgumentError)


12
13
14
15
16
17
18
# File 'lib/rustic/configs/forget.rb', line 12

def keep(last: nil, weekly: nil, monthly: nil)
  raise ArgumentError, "keep options must be provided" if [last, weekly, monthly].all?(&:nil?)

  @keep_last = last
  @keep_weekly = weekly
  @keep_monthly = monthly
end

#prune!Object



20
# File 'lib/rustic/configs/forget.rb', line 20

def prune! = @prune = true