Class: Retab::ConditionEvaluationDetails

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_artifacts/condition_evaluation_details.rb

Constant Summary collapse

HASH_ATTRS =
{
  path: :path,
  operator: :operator,
  expected: :expected,
  actual: :actual,
  matched: :matched,
  per_item: :per_item,
  sub_conditions: :sub_conditions,
  logical_operator: :logical_operator
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

#inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ ConditionEvaluationDetails

Returns a new instance of ConditionEvaluationDetails.



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/retab/workflow_artifacts/condition_evaluation_details.rb', line 29

def initialize(json)
  hash = self.class.normalize(json)
  @path = hash[:path]
  @operator = hash[:operator]
  @expected = hash[:expected]
  @actual = hash[:actual]
  @matched = hash[:matched]
  @per_item = (hash[:per_item] || []).map { |item| item ? Retab::ConditionEvaluationPerItem.new(item) : nil }
  @sub_conditions = (hash[:sub_conditions] || []).map { |item| item ? Retab::ConditionEvaluationSubCondition.new(item) : nil }
  @logical_operator = hash[:logical_operator]
end

Instance Attribute Details

#actualObject

Returns the value of attribute actual.



19
20
21
# File 'lib/retab/workflow_artifacts/condition_evaluation_details.rb', line 19

def actual
  @actual
end

#expectedObject

Returns the value of attribute expected.



19
20
21
# File 'lib/retab/workflow_artifacts/condition_evaluation_details.rb', line 19

def expected
  @expected
end

#logical_operatorObject

Returns the value of attribute logical_operator.



19
20
21
# File 'lib/retab/workflow_artifacts/condition_evaluation_details.rb', line 19

def logical_operator
  @logical_operator
end

#matchedObject

Returns the value of attribute matched.



19
20
21
# File 'lib/retab/workflow_artifacts/condition_evaluation_details.rb', line 19

def matched
  @matched
end

#operatorObject

Returns the value of attribute operator.



19
20
21
# File 'lib/retab/workflow_artifacts/condition_evaluation_details.rb', line 19

def operator
  @operator
end

#pathObject

Returns the value of attribute path.



19
20
21
# File 'lib/retab/workflow_artifacts/condition_evaluation_details.rb', line 19

def path
  @path
end

#per_itemObject

Returns the value of attribute per_item.



19
20
21
# File 'lib/retab/workflow_artifacts/condition_evaluation_details.rb', line 19

def per_item
  @per_item
end

#sub_conditionsObject

Returns the value of attribute sub_conditions.



19
20
21
# File 'lib/retab/workflow_artifacts/condition_evaluation_details.rb', line 19

def sub_conditions
  @sub_conditions
end