Class: Textus::Domain::Policy::Retention
- Inherits:
-
Object
- Object
- Textus::Domain::Policy::Retention
- Defined in:
- lib/textus/domain/policy/retention.rb
Overview
Garbage collection (ADR 0093). A glob-matched rule slot: when an entry ages past ‘ttl`, retire it. Destructive only — runs on the full `reconcile` pass, never on a write (ADR 0079’s invariant). Orthogonal to production (‘source:`): an intake entry can re-pull hourly AND archive after 90 days. `warn`/`refresh` are gone (refresh is implied by an intake source; warn never fired after ADR 0089’s pure-read get).
Constant Summary collapse
- ACTIONS =
%i[drop archive].freeze
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
Instance Method Summary collapse
- #destructive? ⇒ Boolean
-
#initialize(raw) ⇒ Retention
constructor
A new instance of Retention.
- #ttl_seconds ⇒ Object
Constructor Details
#initialize(raw) ⇒ Retention
Returns a new instance of Retention.
15 16 17 18 19 20 21 22 |
# File 'lib/textus/domain/policy/retention.rb', line 15 def initialize(raw) @ttl = raw["ttl"] or raise Textus::BadManifest.new("retention requires a 'ttl:'") @action = (raw["action"] || "").to_s.to_sym return if ACTIONS.include?(@action) raise Textus::BadManifest.new("retention action must be one of #{ACTIONS.join("|")}, got #{raw["action"].inspect}") end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
13 14 15 |
# File 'lib/textus/domain/policy/retention.rb', line 13 def action @action end |