Class: Retab::WorkflowTest

Inherits:
Types::BaseModel show all
Defined in:
lib/retab/workflow_tests/workflow_test.rb

Constant Summary collapse

HASH_ATTRS =
{
  id: :id,
  workflow_id: :workflow_id,
  target: :target,
  source: :source,
  name: :name,
  assertion: :assertion,
  assertion_schema_dep: :assertion_schema_dep,
  assertion_drift_status: :assertion_drift_status,
  schema_drift: :schema_drift,
  schema_drift_detail: :schema_drift_detail,
  validation_status: :validation_status,
  validation_issues: :validation_issues,
  latest_run_summary: :latest_run_summary,
  latest_passing_run_summary: :latest_passing_run_summary,
  latest_failing_run_summary: :latest_failing_run_summary,
  created_at: :created_at,
  updated_at: :updated_at
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

deep_symbolize, #inspect, normalize, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ WorkflowTest

Returns a new instance of WorkflowTest.



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/retab/workflow_tests/workflow_test.rb', line 48

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @id = hash[:id]
  @workflow_id = hash[:workflow_id]
  @target = hash[:target] ? Retab::WorkflowTestBlockTarget.new(hash[:target]) : nil
  @source = hash[:source] ? (
    case hash[:source][:type]
    when "manual"
      Retab::ManualWorkflowTestSource.new(hash[:source])
    when "run_step"
      Retab::RunStepWorkflowTestSource.new(hash[:source])
    else
      hash[:source]
    end
  ) : nil
  @name = hash[:name]
  @assertion = hash[:assertion] ? Retab::AssertionSpec.new(hash[:assertion]) : nil
  @assertion_schema_dep = hash[:assertion_schema_dep] ? Retab::AssertionSchemaDep.new(hash[:assertion_schema_dep]) : nil
  @assertion_drift_status = hash[:assertion_drift_status]
  @schema_drift = hash[:schema_drift]
  @schema_drift_detail = hash[:schema_drift_detail]
  @validation_status = hash[:validation_status]
  @validation_issues = (hash[:validation_issues] || [])
  @latest_run_summary = hash[:latest_run_summary] ? Retab::LatestBlockTestRunSummary.new(hash[:latest_run_summary]) : nil
  @latest_passing_run_summary = hash[:latest_passing_run_summary] ? Retab::LatestBlockTestRunSummary.new(
    hash[:latest_passing_run_summary]
  ) : nil
  @latest_failing_run_summary = hash[:latest_failing_run_summary] ? Retab::LatestBlockTestRunSummary.new(
    hash[:latest_failing_run_summary]
  ) : nil
  @created_at = hash[:created_at]
  @updated_at = hash[:updated_at]
end

Instance Attribute Details

#assertionObject

Returns the value of attribute assertion.



28
29
30
# File 'lib/retab/workflow_tests/workflow_test.rb', line 28

def assertion
  @assertion
end

#assertion_drift_statusObject

Returns the value of attribute assertion_drift_status.



28
29
30
# File 'lib/retab/workflow_tests/workflow_test.rb', line 28

def assertion_drift_status
  @assertion_drift_status
end

#assertion_schema_depObject

Returns the value of attribute assertion_schema_dep.



28
29
30
# File 'lib/retab/workflow_tests/workflow_test.rb', line 28

def assertion_schema_dep
  @assertion_schema_dep
end

#created_atObject

Returns the value of attribute created_at.



28
29
30
# File 'lib/retab/workflow_tests/workflow_test.rb', line 28

def created_at
  @created_at
end

#idObject

Returns the value of attribute id.



28
29
30
# File 'lib/retab/workflow_tests/workflow_test.rb', line 28

def id
  @id
end

#latest_failing_run_summaryObject

Returns the value of attribute latest_failing_run_summary.



28
29
30
# File 'lib/retab/workflow_tests/workflow_test.rb', line 28

def latest_failing_run_summary
  @latest_failing_run_summary
end

#latest_passing_run_summaryObject

Returns the value of attribute latest_passing_run_summary.



28
29
30
# File 'lib/retab/workflow_tests/workflow_test.rb', line 28

def latest_passing_run_summary
  @latest_passing_run_summary
end

#latest_run_summaryObject

Returns the value of attribute latest_run_summary.



28
29
30
# File 'lib/retab/workflow_tests/workflow_test.rb', line 28

def latest_run_summary
  @latest_run_summary
end

#nameObject

Returns the value of attribute name.



28
29
30
# File 'lib/retab/workflow_tests/workflow_test.rb', line 28

def name
  @name
end

#schema_driftObject

Returns the value of attribute schema_drift.



28
29
30
# File 'lib/retab/workflow_tests/workflow_test.rb', line 28

def schema_drift
  @schema_drift
end

#schema_drift_detailObject

Returns the value of attribute schema_drift_detail.



28
29
30
# File 'lib/retab/workflow_tests/workflow_test.rb', line 28

def schema_drift_detail
  @schema_drift_detail
end

#sourceObject

Returns the value of attribute source.



28
29
30
# File 'lib/retab/workflow_tests/workflow_test.rb', line 28

def source
  @source
end

#targetObject

Returns the value of attribute target.



28
29
30
# File 'lib/retab/workflow_tests/workflow_test.rb', line 28

def target
  @target
end

#updated_atObject

Returns the value of attribute updated_at.



28
29
30
# File 'lib/retab/workflow_tests/workflow_test.rb', line 28

def updated_at
  @updated_at
end

#validation_issuesObject

Returns the value of attribute validation_issues.



28
29
30
# File 'lib/retab/workflow_tests/workflow_test.rb', line 28

def validation_issues
  @validation_issues
end

#validation_statusObject

Returns the value of attribute validation_status.



28
29
30
# File 'lib/retab/workflow_tests/workflow_test.rb', line 28

def validation_status
  @validation_status
end

#workflow_idObject

Returns the value of attribute workflow_id.



28
29
30
# File 'lib/retab/workflow_tests/workflow_test.rb', line 28

def workflow_id
  @workflow_id
end