Class: Reviewer::Setup::Detector::Result
- Inherits:
-
Struct
- Object
- Struct
- Reviewer::Setup::Detector::Result
- Defined in:
- lib/reviewer/setup/detector.rb
Overview
Value object for a single detection result (tool key + evidence).
Instance Attribute Summary collapse
-
#key ⇒ Symbol
The tool identifier from the catalog.
-
#reasons ⇒ Array<String>
Evidence strings explaining why the tool was detected.
Instance Method Summary collapse
-
#name ⇒ String
Human-readable tool name from the catalog, or the key as fallback.
-
#summary ⇒ String
Formatted line for display (name + reasons).
Instance Attribute Details
#key ⇒ Symbol
Returns the tool identifier from the catalog.
13 14 15 16 17 18 |
# File 'lib/reviewer/setup/detector.rb', line 13 Result = Struct.new(:key, :reasons, keyword_init: true) do # @return [String] human-readable tool name from the catalog, or the key as fallback def name = Catalog.config_for(key)&.dig(:name) || key.to_s # @return [String] formatted line for display (name + reasons) def summary = " #{name.ljust(22)}#{reasons.join(', ')}" end |
#reasons ⇒ Array<String>
Returns evidence strings explaining why the tool was detected.
13 14 15 16 17 18 |
# File 'lib/reviewer/setup/detector.rb', line 13 Result = Struct.new(:key, :reasons, keyword_init: true) do # @return [String] human-readable tool name from the catalog, or the key as fallback def name = Catalog.config_for(key)&.dig(:name) || key.to_s # @return [String] formatted line for display (name + reasons) def summary = " #{name.ljust(22)}#{reasons.join(', ')}" end |
Instance Method Details
#name ⇒ String
Returns human-readable tool name from the catalog, or the key as fallback.
15 16 |
# File 'lib/reviewer/setup/detector.rb', line 15 def name = Catalog.config_for(key)&.dig(:name) || key.to_s # @return [String] formatted line for display (name + reasons) |
#summary ⇒ String
Returns formatted line for display (name + reasons).
17 |
# File 'lib/reviewer/setup/detector.rb', line 17 def summary = " #{name.ljust(22)}#{reasons.join(', ')}" |