Class: Retab::ConditionEvaluationSubCondition

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

Constant Summary collapse

HASH_ATTRS =
{
  sub_condition_id: :sub_condition_id,
  path: :path,
  operator: :operator,
  expected: :expected,
  actual: :actual,
  matched: :matched,
  per_item: :per_item
}.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) ⇒ ConditionEvaluationSubCondition

Returns a new instance of ConditionEvaluationSubCondition.



27
28
29
30
31
32
33
34
35
36
# File 'lib/retab/workflow_artifacts/condition_evaluation_sub_condition.rb', line 27

def initialize(json)
  hash = self.class.normalize(json)
  @sub_condition_id = hash[:sub_condition_id]
  @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 }
end

Instance Attribute Details

#actualObject

Returns the value of attribute actual.



18
19
20
# File 'lib/retab/workflow_artifacts/condition_evaluation_sub_condition.rb', line 18

def actual
  @actual
end

#expectedObject

Returns the value of attribute expected.



18
19
20
# File 'lib/retab/workflow_artifacts/condition_evaluation_sub_condition.rb', line 18

def expected
  @expected
end

#matchedObject

Returns the value of attribute matched.



18
19
20
# File 'lib/retab/workflow_artifacts/condition_evaluation_sub_condition.rb', line 18

def matched
  @matched
end

#operatorObject

Returns the value of attribute operator.



18
19
20
# File 'lib/retab/workflow_artifacts/condition_evaluation_sub_condition.rb', line 18

def operator
  @operator
end

#pathObject

Returns the value of attribute path.



18
19
20
# File 'lib/retab/workflow_artifacts/condition_evaluation_sub_condition.rb', line 18

def path
  @path
end

#per_itemObject

Returns the value of attribute per_item.



18
19
20
# File 'lib/retab/workflow_artifacts/condition_evaluation_sub_condition.rb', line 18

def per_item
  @per_item
end

#sub_condition_idObject

Returns the value of attribute sub_condition_id.



18
19
20
# File 'lib/retab/workflow_artifacts/condition_evaluation_sub_condition.rb', line 18

def sub_condition_id
  @sub_condition_id
end