Class: Rigor::CLI::ProtectionRenderer
- Inherits:
-
Object
- Object
- Rigor::CLI::ProtectionRenderer
- Defined in:
- lib/rigor/cli/protection_renderer.rb
Overview
Renders an ProtectionReport (ADR-63 Tier 1) as text or JSON. The text form leads with the protected ratio, then the highest-traffic untyped dispatches (“add a type here”), then the lowest-protected files. The framing is always *where to add a type*, never “your code is broken”.
Constant Summary collapse
- TOP_CALLS =
15- TOP_FILES =
10
Instance Method Summary collapse
-
#initialize(out:) ⇒ ProtectionRenderer
constructor
A new instance of ProtectionRenderer.
- #render(report, format:) ⇒ Object
Constructor Details
#initialize(out:) ⇒ ProtectionRenderer
Returns a new instance of ProtectionRenderer.
15 16 17 |
# File 'lib/rigor/cli/protection_renderer.rb', line 15 def initialize(out:) @out = out end |
Instance Method Details
#render(report, format:) ⇒ Object
19 20 21 |
# File 'lib/rigor/cli/protection_renderer.rb', line 19 def render(report, format:) format == "json" ? render_json(report) : render_text(report) end |