Class: DecisionAgent::Testing::ComparisonResult
- Inherits:
-
Object
- Object
- DecisionAgent::Testing::ComparisonResult
- Defined in:
- lib/decision_agent/testing/test_result_comparator.rb
Overview
Comparison result for a single test scenario
Instance Attribute Summary collapse
-
#actual ⇒ Object
readonly
Returns the value of attribute actual.
-
#confidence_match ⇒ Object
readonly
Returns the value of attribute confidence_match.
-
#decision_match ⇒ Object
readonly
Returns the value of attribute decision_match.
-
#differences ⇒ Object
readonly
Returns the value of attribute differences.
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
-
#match ⇒ Object
readonly
Returns the value of attribute match.
-
#scenario_id ⇒ Object
readonly
Returns the value of attribute scenario_id.
Instance Method Summary collapse
-
#initialize(scenario_id:, match:, decision_match:, confidence_match:, differences:, actual:, expected:) ⇒ ComparisonResult
constructor
A new instance of ComparisonResult.
- #to_h ⇒ Object
Constructor Details
#initialize(scenario_id:, match:, decision_match:, confidence_match:, differences:, actual:, expected:) ⇒ ComparisonResult
Returns a new instance of ComparisonResult.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/decision_agent/testing/test_result_comparator.rb', line 9 def initialize(scenario_id:, match:, decision_match:, confidence_match:, differences:, actual:, expected:) @scenario_id = scenario_id.to_s.freeze @match = match @decision_match = decision_match @confidence_match = confidence_match @differences = differences.freeze @actual = actual @expected = expected freeze end |
Instance Attribute Details
#actual ⇒ Object (readonly)
Returns the value of attribute actual.
7 8 9 |
# File 'lib/decision_agent/testing/test_result_comparator.rb', line 7 def actual @actual end |
#confidence_match ⇒ Object (readonly)
Returns the value of attribute confidence_match.
7 8 9 |
# File 'lib/decision_agent/testing/test_result_comparator.rb', line 7 def confidence_match @confidence_match end |
#decision_match ⇒ Object (readonly)
Returns the value of attribute decision_match.
7 8 9 |
# File 'lib/decision_agent/testing/test_result_comparator.rb', line 7 def decision_match @decision_match end |
#differences ⇒ Object (readonly)
Returns the value of attribute differences.
7 8 9 |
# File 'lib/decision_agent/testing/test_result_comparator.rb', line 7 def differences @differences end |
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
7 8 9 |
# File 'lib/decision_agent/testing/test_result_comparator.rb', line 7 def expected @expected end |
#match ⇒ Object (readonly)
Returns the value of attribute match.
7 8 9 |
# File 'lib/decision_agent/testing/test_result_comparator.rb', line 7 def match @match end |
#scenario_id ⇒ Object (readonly)
Returns the value of attribute scenario_id.
7 8 9 |
# File 'lib/decision_agent/testing/test_result_comparator.rb', line 7 def scenario_id @scenario_id end |
Instance Method Details
#to_h ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/decision_agent/testing/test_result_comparator.rb', line 21 def to_h { scenario_id: @scenario_id, match: @match, decision_match: @decision_match, confidence_match: @confidence_match, differences: @differences, actual: { decision: @actual[:decision], confidence: @actual[:confidence] }, expected: { decision: @expected[:decision], confidence: @expected[:confidence] } } end |