Class: Retab::AssertionResult
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::AssertionResult
- Defined in:
- lib/retab/workflow_test_run_results/assertion_result.rb
Constant Summary collapse
- HASH_ATTRS =
{ assertion_id: :assertion_id, condition_kind: :condition_kind, outcome: :outcome, actual_value: :actual_value, expected_value: :expected_value, score: :score, threshold: :threshold, metric_kind: :metric_kind, assertion_label: :assertion_label, failure: :failure }.freeze
Instance Attribute Summary collapse
-
#actual_value ⇒ Object
Returns the value of attribute actual_value.
-
#assertion_id ⇒ Object
Returns the value of attribute assertion_id.
-
#assertion_label ⇒ Object
Returns the value of attribute assertion_label.
-
#condition_kind ⇒ Object
Returns the value of attribute condition_kind.
-
#expected_value ⇒ Object
Returns the value of attribute expected_value.
-
#failure ⇒ Object
Returns the value of attribute failure.
-
#metric_kind ⇒ Object
Returns the value of attribute metric_kind.
-
#outcome ⇒ Object
Returns the value of attribute outcome.
-
#score ⇒ Object
Returns the value of attribute score.
-
#threshold ⇒ Object
Returns the value of attribute threshold.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ AssertionResult
constructor
A new instance of AssertionResult.
Methods inherited from Types::BaseModel
#inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ AssertionResult
Returns a new instance of AssertionResult.
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/retab/workflow_test_run_results/assertion_result.rb', line 33 def initialize(json) hash = self.class.normalize(json) @assertion_id = hash[:assertion_id] @condition_kind = hash[:condition_kind] @outcome = hash[:outcome] @actual_value = hash[:actual_value] @expected_value = hash[:expected_value] @score = hash[:score] @threshold = hash[:threshold] @metric_kind = hash[:metric_kind] @assertion_label = hash[:assertion_label] @failure = hash[:failure] ? Retab::AssertionFailure.new(hash[:failure]) : nil end |
Instance Attribute Details
#actual_value ⇒ Object
Returns the value of attribute actual_value.
21 22 23 |
# File 'lib/retab/workflow_test_run_results/assertion_result.rb', line 21 def actual_value @actual_value end |
#assertion_id ⇒ Object
Returns the value of attribute assertion_id.
21 22 23 |
# File 'lib/retab/workflow_test_run_results/assertion_result.rb', line 21 def assertion_id @assertion_id end |
#assertion_label ⇒ Object
Returns the value of attribute assertion_label.
21 22 23 |
# File 'lib/retab/workflow_test_run_results/assertion_result.rb', line 21 def assertion_label @assertion_label end |
#condition_kind ⇒ Object
Returns the value of attribute condition_kind.
21 22 23 |
# File 'lib/retab/workflow_test_run_results/assertion_result.rb', line 21 def condition_kind @condition_kind end |
#expected_value ⇒ Object
Returns the value of attribute expected_value.
21 22 23 |
# File 'lib/retab/workflow_test_run_results/assertion_result.rb', line 21 def expected_value @expected_value end |
#failure ⇒ Object
Returns the value of attribute failure.
21 22 23 |
# File 'lib/retab/workflow_test_run_results/assertion_result.rb', line 21 def failure @failure end |
#metric_kind ⇒ Object
Returns the value of attribute metric_kind.
21 22 23 |
# File 'lib/retab/workflow_test_run_results/assertion_result.rb', line 21 def metric_kind @metric_kind end |
#outcome ⇒ Object
Returns the value of attribute outcome.
21 22 23 |
# File 'lib/retab/workflow_test_run_results/assertion_result.rb', line 21 def outcome @outcome end |
#score ⇒ Object
Returns the value of attribute score.
21 22 23 |
# File 'lib/retab/workflow_test_run_results/assertion_result.rb', line 21 def score @score end |
#threshold ⇒ Object
Returns the value of attribute threshold.
21 22 23 |
# File 'lib/retab/workflow_test_run_results/assertion_result.rb', line 21 def threshold @threshold end |