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.
-
#sources ⇒ Object
Returns the value of attribute sources.
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.
29 30 31 32 33 34 35 |
# File 'lib/reviewer/setup/detector.rb', line 29 Result = Struct.new(:key, :sources, 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 def reasons = sources.map(&:description) # @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.
29 30 31 32 33 34 35 |
# File 'lib/reviewer/setup/detector.rb', line 29 Result = Struct.new(:key, :sources, 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 def reasons = sources.map(&:description) # @return [String] formatted line for display (name + reasons) def summary = " #{name.ljust(22)}#{reasons.join(', ')}" end |
#sources ⇒ Object
Returns the value of attribute sources
29 30 31 |
# File 'lib/reviewer/setup/detector.rb', line 29 def sources @sources end |
Instance Method Details
#name ⇒ String
Returns human-readable tool name from the catalog, or the key as fallback.
31 |
# File 'lib/reviewer/setup/detector.rb', line 31 def name = Catalog.config_for(key)&.dig(:name) || key.to_s |
#summary ⇒ String
Returns formatted line for display (name + reasons).
34 |
# File 'lib/reviewer/setup/detector.rb', line 34 def summary = " #{name.ljust(22)}#{reasons.join(', ')}" |