Class: Retab::WorkflowTestRun
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::WorkflowTestRun
- Defined in:
- lib/retab/workflow_test_runs/workflow_test_run.rb
Constant Summary collapse
- HASH_ATTRS =
{ id: :id, workflow_id: :workflow_id, workflow_version_id: :workflow_version_id, trigger: :trigger, lifecycle: :lifecycle, timing: :timing, target: :target, test_id: :test_id, total_tests: :total_tests, counts: :counts, freshness: :freshness }.freeze
Instance Attribute Summary collapse
-
#counts ⇒ Object
Returns the value of attribute counts.
-
#freshness ⇒ Object
Returns the value of attribute freshness.
-
#id ⇒ Object
Returns the value of attribute id.
-
#lifecycle ⇒ Object
Returns the value of attribute lifecycle.
-
#target ⇒ Object
Returns the value of attribute target.
-
#test_id ⇒ Object
Returns the value of attribute test_id.
-
#timing ⇒ Object
Returns the value of attribute timing.
-
#total_tests ⇒ Object
Returns the value of attribute total_tests.
-
#trigger ⇒ Object
Returns the value of attribute trigger.
-
#workflow_id ⇒ Object
Returns the value of attribute workflow_id.
-
#workflow_version_id ⇒ Object
Returns the value of attribute workflow_version_id.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ WorkflowTestRun
constructor
A new instance of WorkflowTestRun.
Methods inherited from Types::BaseModel
deep_symbolize, #inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ WorkflowTestRun
Returns a new instance of WorkflowTestRun.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/retab/workflow_test_runs/workflow_test_run.rb', line 36 def initialize(json) super() hash = self.class.normalize(json) @id = hash[:id] @workflow_id = hash[:workflow_id] @workflow_version_id = hash[:workflow_version_id] @trigger = hash[:trigger] ? Retab::TriggerInfo.new(hash[:trigger]) : nil @lifecycle = hash[:lifecycle] ? ( case hash[:lifecycle][:status] when "cancelled" Retab::CancelledWorkflowTestRun.new(hash[:lifecycle]) when "completed" Retab::CompletedWorkflowTestRun.new(hash[:lifecycle]) when "error" Retab::ErrorWorkflowTestRun.new(hash[:lifecycle]) when "pending" Retab::PendingWorkflowTestRun.new(hash[:lifecycle]) when "queued" Retab::QueuedWorkflowTestRun.new(hash[:lifecycle]) when "running" Retab::RunningWorkflowTestRun.new(hash[:lifecycle]) else hash[:lifecycle] end ) : nil @timing = hash[:timing] ? Retab::WorkflowTestRunTiming.new(hash[:timing]) : nil @target = hash[:target] ? Retab::WorkflowTestBlockTarget.new(hash[:target]) : nil @test_id = hash[:test_id] @total_tests = hash[:total_tests] @counts = hash[:counts] ? Retab::BlockTestBatchExecutionCounts.new(hash[:counts]) : nil @freshness = hash[:freshness] ? Retab::ArtifactFreshness.new(hash[:freshness]) : nil end |
Instance Attribute Details
#counts ⇒ Object
Returns the value of attribute counts.
22 23 24 |
# File 'lib/retab/workflow_test_runs/workflow_test_run.rb', line 22 def counts @counts end |
#freshness ⇒ Object
Returns the value of attribute freshness.
22 23 24 |
# File 'lib/retab/workflow_test_runs/workflow_test_run.rb', line 22 def freshness @freshness end |
#id ⇒ Object
Returns the value of attribute id.
22 23 24 |
# File 'lib/retab/workflow_test_runs/workflow_test_run.rb', line 22 def id @id end |
#lifecycle ⇒ Object
Returns the value of attribute lifecycle.
22 23 24 |
# File 'lib/retab/workflow_test_runs/workflow_test_run.rb', line 22 def lifecycle @lifecycle end |
#target ⇒ Object
Returns the value of attribute target.
22 23 24 |
# File 'lib/retab/workflow_test_runs/workflow_test_run.rb', line 22 def target @target end |
#test_id ⇒ Object
Returns the value of attribute test_id.
22 23 24 |
# File 'lib/retab/workflow_test_runs/workflow_test_run.rb', line 22 def test_id @test_id end |
#timing ⇒ Object
Returns the value of attribute timing.
22 23 24 |
# File 'lib/retab/workflow_test_runs/workflow_test_run.rb', line 22 def timing @timing end |
#total_tests ⇒ Object
Returns the value of attribute total_tests.
22 23 24 |
# File 'lib/retab/workflow_test_runs/workflow_test_run.rb', line 22 def total_tests @total_tests end |
#trigger ⇒ Object
Returns the value of attribute trigger.
22 23 24 |
# File 'lib/retab/workflow_test_runs/workflow_test_run.rb', line 22 def trigger @trigger end |
#workflow_id ⇒ Object
Returns the value of attribute workflow_id.
22 23 24 |
# File 'lib/retab/workflow_test_runs/workflow_test_run.rb', line 22 def workflow_id @workflow_id end |
#workflow_version_id ⇒ Object
Returns the value of attribute workflow_version_id.
22 23 24 |
# File 'lib/retab/workflow_test_runs/workflow_test_run.rb', line 22 def workflow_version_id @workflow_version_id end |