Class: Expire::KeepMostRecentForRule
- Inherits:
-
FromNowKeepMostRecentForRule
- Object
- RuleBase
- FromNowKeepMostRecentForRule
- Expire::KeepMostRecentForRule
- Extended by:
- FromRangeValue
- Includes:
- NumerusUnit
- Defined in:
- lib/expire/keep_most_recent_for_rule.rb
Overview
Keep the most recent backups for a certain period of time.
Constant Summary collapse
- RULE_RANK =
11
Constants included from FromRangeValue
FromRangeValue::FROM_VALUE_REGEX
Instance Attribute Summary collapse
-
#unit ⇒ Object
readonly
Returns the value of attribute unit.
Attributes inherited from RuleBase
Class Method Summary collapse
Instance Method Summary collapse
Methods included from FromRangeValue
Methods included from NumerusUnit
Methods inherited from FromNowKeepMostRecentForRule
Methods inherited from RuleBase
<=>, #<=>, camelized_name, #initialize, name, #name, #numerus_backup, #option_name, option_name
Constructor Details
This class inherits a constructor from Expire::FromNowKeepMostRecentForRule
Instance Attribute Details
#unit ⇒ Object (readonly)
Returns the value of attribute unit.
12 13 14 |
# File 'lib/expire/keep_most_recent_for_rule.rb', line 12 def unit @unit end |
Class Method Details
.rank ⇒ Object
14 15 16 |
# File 'lib/expire/keep_most_recent_for_rule.rb', line 14 def self.rank RULE_RANK end |
Instance Method Details
#apply(backups, _) ⇒ Object
18 19 20 21 |
# File 'lib/expire/keep_most_recent_for_rule.rb', line 18 def apply(backups, _) reference_time = backups.newest super(backups, reference_time) end |
#rank ⇒ Object
23 24 25 |
# File 'lib/expire/keep_most_recent_for_rule.rb', line 23 def rank self.class.rank end |
#reason_to_keep ⇒ Object
27 28 29 |
# File 'lib/expire/keep_most_recent_for_rule.rb', line 27 def reason_to_keep "keep most recent backups for #{amount} #{numerus_unit}" end |