Class: Textus::Application::Reads::Freshness
- Inherits:
-
Object
- Object
- Textus::Application::Reads::Freshness
- Defined in:
- lib/textus/application/reads/freshness.rb
Overview
Per-entry freshness report. Walks every entry declared in the manifest, consults ‘policies_for(key)` for a refresh policy, and reports the current status. Status is one of :fresh, :stale, :never_refreshed, or :no_policy.
Instance Method Summary collapse
- #call(prefix: nil, zone: nil) ⇒ Object
-
#initialize(ctx:, evaluator: Textus::Domain::Freshness::Evaluator) ⇒ Freshness
constructor
A new instance of Freshness.
Constructor Details
Instance Method Details
#call(prefix: nil, zone: nil) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/textus/application/reads/freshness.rb', line 16 def call(prefix: nil, zone: nil) rows = [] @ctx.store.manifest.entries.each do |mentry| next if prefix && !mentry.key.start_with?(prefix) next if zone && mentry.zone != zone rows << row_for(mentry) end rows end |