Class: Retab::ConditionEvaluationResult
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::ConditionEvaluationResult
- Defined in:
- lib/retab/workflow_artifacts/condition_evaluation_result.rb
Constant Summary collapse
- HASH_ATTRS =
{ condition_id: :condition_id, path: :path, operator: :operator, expected: :expected, actual: :actual, matched: :matched, branch_name: :branch_name, logical_operator: :logical_operator, per_item: :per_item, sub_evaluations: :sub_evaluations, details: :details }.freeze
Instance Attribute Summary collapse
-
#actual ⇒ Object
Returns the value of attribute actual.
-
#branch_name ⇒ Object
Returns the value of attribute branch_name.
-
#condition_id ⇒ Object
Returns the value of attribute condition_id.
-
#details ⇒ Object
Returns the value of attribute details.
-
#expected ⇒ Object
Returns the value of attribute expected.
-
#logical_operator ⇒ Object
Returns the value of attribute logical_operator.
-
#matched ⇒ Object
Returns the value of attribute matched.
-
#operator ⇒ Object
Returns the value of attribute operator.
-
#path ⇒ Object
Returns the value of attribute path.
-
#per_item ⇒ Object
Returns the value of attribute per_item.
-
#sub_evaluations ⇒ Object
Returns the value of attribute sub_evaluations.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ ConditionEvaluationResult
constructor
A new instance of ConditionEvaluationResult.
Methods inherited from Types::BaseModel
#inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ ConditionEvaluationResult
Returns a new instance of ConditionEvaluationResult.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/retab/workflow_artifacts/condition_evaluation_result.rb', line 35 def initialize(json) hash = self.class.normalize(json) @condition_id = hash[:condition_id] @path = hash[:path] @operator = hash[:operator] @expected = hash[:expected] @actual = hash[:actual] @matched = hash[:matched] @branch_name = hash[:branch_name] @logical_operator = hash[:logical_operator] @per_item = (hash[:per_item] || []).map { |item| item ? Retab::ConditionEvaluationPerItem.new(item) : nil } @sub_evaluations = (hash[:sub_evaluations] || []).map { |item| item ? Retab::ConditionEvaluationSubCondition.new(item) : nil } @details = hash[:details] ? Retab::ConditionEvaluationDetails.new(hash[:details]) : nil end |
Instance Attribute Details
#actual ⇒ Object
Returns the value of attribute actual.
22 23 24 |
# File 'lib/retab/workflow_artifacts/condition_evaluation_result.rb', line 22 def actual @actual end |
#branch_name ⇒ Object
Returns the value of attribute branch_name.
22 23 24 |
# File 'lib/retab/workflow_artifacts/condition_evaluation_result.rb', line 22 def branch_name @branch_name end |
#condition_id ⇒ Object
Returns the value of attribute condition_id.
22 23 24 |
# File 'lib/retab/workflow_artifacts/condition_evaluation_result.rb', line 22 def condition_id @condition_id end |
#details ⇒ Object
Returns the value of attribute details.
22 23 24 |
# File 'lib/retab/workflow_artifacts/condition_evaluation_result.rb', line 22 def details @details end |
#expected ⇒ Object
Returns the value of attribute expected.
22 23 24 |
# File 'lib/retab/workflow_artifacts/condition_evaluation_result.rb', line 22 def expected @expected end |
#logical_operator ⇒ Object
Returns the value of attribute logical_operator.
22 23 24 |
# File 'lib/retab/workflow_artifacts/condition_evaluation_result.rb', line 22 def logical_operator @logical_operator end |
#matched ⇒ Object
Returns the value of attribute matched.
22 23 24 |
# File 'lib/retab/workflow_artifacts/condition_evaluation_result.rb', line 22 def matched @matched end |
#operator ⇒ Object
Returns the value of attribute operator.
22 23 24 |
# File 'lib/retab/workflow_artifacts/condition_evaluation_result.rb', line 22 def operator @operator end |
#path ⇒ Object
Returns the value of attribute path.
22 23 24 |
# File 'lib/retab/workflow_artifacts/condition_evaluation_result.rb', line 22 def path @path end |
#per_item ⇒ Object
Returns the value of attribute per_item.
22 23 24 |
# File 'lib/retab/workflow_artifacts/condition_evaluation_result.rb', line 22 def per_item @per_item end |
#sub_evaluations ⇒ Object
Returns the value of attribute sub_evaluations.
22 23 24 |
# File 'lib/retab/workflow_artifacts/condition_evaluation_result.rb', line 22 def sub_evaluations @sub_evaluations end |