Class: Rustic::Configs::Forget
- Inherits:
-
Object
- Object
- Rustic::Configs::Forget
- Includes:
- HooksExt
- Defined in:
- lib/rustic/configs/forget.rb
Instance Attribute Summary collapse
-
#keep_last ⇒ Object
readonly
Returns the value of attribute keep_last.
-
#keep_monthly ⇒ Object
readonly
Returns the value of attribute keep_monthly.
-
#keep_weekly ⇒ Object
readonly
Returns the value of attribute keep_weekly.
-
#prune ⇒ Object
readonly
Returns the value of attribute prune.
Instance Method Summary collapse
-
#initialize ⇒ Forget
constructor
A new instance of Forget.
- #keep(last: nil, weekly: nil, monthly: nil) ⇒ Object
- #prune! ⇒ Object
Methods included from HooksExt
Constructor Details
#initialize ⇒ Forget
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_last ⇒ Object (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_monthly ⇒ Object (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_weekly ⇒ Object (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 |
#prune ⇒ Object (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
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 |