Class: Retab::ConditionalEvaluation

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

Constant Summary collapse

HASH_ATTRS =
{
  operation: :operation,
  id: :id,
  workflow_run_id: :workflow_run_id,
  step_id: :step_id,
  evaluations: :evaluations,
  selected_handles: :selected_handles,
  matched_branch_id: :matched_branch_id,
  matched_condition_ids: :matched_condition_ids,
  created_at: :created_at
}.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) ⇒ ConditionalEvaluation

Returns a new instance of ConditionalEvaluation.



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/retab/workflow_artifacts/conditional_evaluation.rb', line 31

def initialize(json)
  hash = self.class.normalize(json)
  @operation = hash[:operation]
  @id = hash[:id]
  @workflow_run_id = hash[:workflow_run_id]
  @step_id = hash[:step_id]
  @evaluations = (hash[:evaluations] || []).map { |item| item ? Retab::ConditionEvaluationResult.new(item) : nil }
  @selected_handles = (hash[:selected_handles] || [])
  @matched_branch_id = hash[:matched_branch_id]
  @matched_condition_ids = (hash[:matched_condition_ids] || [])
  @created_at = hash[:created_at]
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



20
21
22
# File 'lib/retab/workflow_artifacts/conditional_evaluation.rb', line 20

def created_at
  @created_at
end

#evaluationsObject

Returns the value of attribute evaluations.



20
21
22
# File 'lib/retab/workflow_artifacts/conditional_evaluation.rb', line 20

def evaluations
  @evaluations
end

#idObject

Returns the value of attribute id.



20
21
22
# File 'lib/retab/workflow_artifacts/conditional_evaluation.rb', line 20

def id
  @id
end

#matched_branch_idObject

Returns the value of attribute matched_branch_id.



20
21
22
# File 'lib/retab/workflow_artifacts/conditional_evaluation.rb', line 20

def matched_branch_id
  @matched_branch_id
end

#matched_condition_idsObject

Returns the value of attribute matched_condition_ids.



20
21
22
# File 'lib/retab/workflow_artifacts/conditional_evaluation.rb', line 20

def matched_condition_ids
  @matched_condition_ids
end

#operationObject

Returns the value of attribute operation.



20
21
22
# File 'lib/retab/workflow_artifacts/conditional_evaluation.rb', line 20

def operation
  @operation
end

#selected_handlesObject

Returns the value of attribute selected_handles.



20
21
22
# File 'lib/retab/workflow_artifacts/conditional_evaluation.rb', line 20

def selected_handles
  @selected_handles
end

#step_idObject

Returns the value of attribute step_id.



20
21
22
# File 'lib/retab/workflow_artifacts/conditional_evaluation.rb', line 20

def step_id
  @step_id
end

#workflow_run_idObject

Returns the value of attribute workflow_run_id.



20
21
22
# File 'lib/retab/workflow_artifacts/conditional_evaluation.rb', line 20

def workflow_run_id
  @workflow_run_id
end