Class: Retab::ReviewEvaluation

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_artifacts/review_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,
  requires_human_review: :requires_human_review,
  reviewer_id: :reviewer_id,
  review_decision: :review_decision,
  review_notes: :review_notes,
  requested_revision: :requested_revision,
  reviewed_at: :reviewed_at,
  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) ⇒ ReviewEvaluation

Returns a new instance of ReviewEvaluation.



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/retab/workflow_artifacts/review_evaluation.rb', line 43

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] || [])
  @requires_human_review = hash[:requires_human_review]
  @reviewer_id = hash[:reviewer_id]
  @review_decision = hash[:review_decision]
  @review_notes = hash[:review_notes]
  @requested_revision = hash[:requested_revision]
  @reviewed_at = hash[:reviewed_at]
  @created_at = hash[:created_at]
end

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



26
27
28
# File 'lib/retab/workflow_artifacts/review_evaluation.rb', line 26

def created_at
  @created_at
end

#evaluationsObject

Returns the value of attribute evaluations.



26
27
28
# File 'lib/retab/workflow_artifacts/review_evaluation.rb', line 26

def evaluations
  @evaluations
end

#idObject

Returns the value of attribute id.



26
27
28
# File 'lib/retab/workflow_artifacts/review_evaluation.rb', line 26

def id
  @id
end

#matched_branch_idObject

Returns the value of attribute matched_branch_id.



26
27
28
# File 'lib/retab/workflow_artifacts/review_evaluation.rb', line 26

def matched_branch_id
  @matched_branch_id
end

#matched_condition_idsObject

Returns the value of attribute matched_condition_ids.



26
27
28
# File 'lib/retab/workflow_artifacts/review_evaluation.rb', line 26

def matched_condition_ids
  @matched_condition_ids
end

#operationObject

Returns the value of attribute operation.



26
27
28
# File 'lib/retab/workflow_artifacts/review_evaluation.rb', line 26

def operation
  @operation
end

#requested_revisionObject

Returns the value of attribute requested_revision.



26
27
28
# File 'lib/retab/workflow_artifacts/review_evaluation.rb', line 26

def requested_revision
  @requested_revision
end

#requires_human_reviewObject

Returns the value of attribute requires_human_review.



26
27
28
# File 'lib/retab/workflow_artifacts/review_evaluation.rb', line 26

def requires_human_review
  @requires_human_review
end

#review_decisionObject

Returns the value of attribute review_decision.



26
27
28
# File 'lib/retab/workflow_artifacts/review_evaluation.rb', line 26

def review_decision
  @review_decision
end

#review_notesObject

Returns the value of attribute review_notes.



26
27
28
# File 'lib/retab/workflow_artifacts/review_evaluation.rb', line 26

def review_notes
  @review_notes
end

#reviewed_atObject

Returns the value of attribute reviewed_at.



26
27
28
# File 'lib/retab/workflow_artifacts/review_evaluation.rb', line 26

def reviewed_at
  @reviewed_at
end

#reviewer_idObject

Returns the value of attribute reviewer_id.



26
27
28
# File 'lib/retab/workflow_artifacts/review_evaluation.rb', line 26

def reviewer_id
  @reviewer_id
end

#selected_handlesObject

Returns the value of attribute selected_handles.



26
27
28
# File 'lib/retab/workflow_artifacts/review_evaluation.rb', line 26

def selected_handles
  @selected_handles
end

#step_idObject

Returns the value of attribute step_id.



26
27
28
# File 'lib/retab/workflow_artifacts/review_evaluation.rb', line 26

def step_id
  @step_id
end

#workflow_run_idObject

Returns the value of attribute workflow_run_id.



26
27
28
# File 'lib/retab/workflow_artifacts/review_evaluation.rb', line 26

def workflow_run_id
  @workflow_run_id
end