Module: CovLoupe::Presenters::PayloadCaching
- Included in:
- BaseCoveragePresenter, ProjectCoveragePresenter, ProjectTotalsPresenter
- Defined in:
- lib/cov_loupe/presenters/payload_caching.rb
Overview
Shared memoization logic for coverage payloads.
Two-stage caching:
1. absolute_payload — raw data with absolute file paths (cached per presenter instance)
2. relativized_payload — same data with paths converted relative to project root
Consumers must implement #compute_absolute_payload to define what data to fetch.
Instance Method Summary collapse
-
#absolute_payload ⇒ Object
Returns the absolute-path payload.
-
#relativized_payload ⇒ Object
Returns the payload with file paths relativized for presentation.
Instance Method Details
#absolute_payload ⇒ Object
Returns the absolute-path payload. Consumers must implement #compute_absolute_payload.
15 16 17 |
# File 'lib/cov_loupe/presenters/payload_caching.rb', line 15 def absolute_payload @absolute_payload ||= compute_absolute_payload end |
#relativized_payload ⇒ Object
Returns the payload with file paths relativized for presentation.
20 21 22 |
# File 'lib/cov_loupe/presenters/payload_caching.rb', line 20 def relativized_payload @relativized_payload ||= model.relativize(absolute_payload) end |