Class: SkillBench::Services::ComparisonReporter
- Inherits:
-
Object
- Object
- SkillBench::Services::ComparisonReporter
- Defined in:
- lib/skill_bench/services/comparison_reporter.rb
Overview
Prints a formatted comparison report for two evaluation results.
Class Method Summary collapse
-
.call(result_a, result_b, label_a, label_b) ⇒ nil
Prints the comparison report to stdout.
Instance Method Summary collapse
-
#call ⇒ nil
Prints the comparison report to stdout.
-
#initialize(result_a, result_b, label_a, label_b) ⇒ ComparisonReporter
constructor
A new instance of ComparisonReporter.
Constructor Details
#initialize(result_a, result_b, label_a, label_b) ⇒ ComparisonReporter
Returns a new instance of ComparisonReporter.
22 23 24 25 26 27 |
# File 'lib/skill_bench/services/comparison_reporter.rb', line 22 def initialize(result_a, result_b, label_a, label_b) @result_a = result_a @result_b = result_b @label_a = label_a @label_b = label_b end |
Class Method Details
.call(result_a, result_b, label_a, label_b) ⇒ nil
Prints the comparison report to stdout.
14 15 16 |
# File 'lib/skill_bench/services/comparison_reporter.rb', line 14 def self.call(result_a, result_b, label_a, label_b) new(result_a, result_b, label_a, label_b).call end |
Instance Method Details
#call ⇒ nil
Prints the comparison report to stdout.
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/skill_bench/services/comparison_reporter.rb', line 32 def call puts "\n=== Comparison Report ===" puts "| Dimension | #{@label_a} | #{@label_b} | Delta |" puts '|-----------|----------|----------|-------|' report_a = @result_a.dig(:response, :report) report_b = @result_b.dig(:response, :report) return unless report_a && report_b print_dimension_scores(report_a, report_b) print_total_scores(report_a, report_b) print_verdicts(report_a, report_b) end |