Class: Jiminy::Reporting::CIProviders::CircleCI::Workflow

Inherits:
Base
  • Object
show all
Defined in:
lib/jiminy/reporting/ci_providers/circle_ci/workflow.rb

Constant Summary collapse

SUCCESS =
"success"
FAILED =
"failed"
NOT_RUN =
"not run"
RUNNING =
"running"

Instance Attribute Summary

Attributes inherited from Base

#attributes

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

define_attribute_readers, fetch_api_resource, #initialize

Constructor Details

This class inherits a constructor from Jiminy::Reporting::CIProviders::CircleCI::Base

Class Method Details

.find(pipeline_id:, workflow_name:) ⇒ Object



16
17
18
19
20
# File 'lib/jiminy/reporting/ci_providers/circle_ci/workflow.rb', line 16

def self.find(pipeline_id:, workflow_name:)
  url = "pipeline/#{pipeline_id}/workflow"
  collection = fetch_api_resource(url)
  collection.detect { |w| w.name.to_s == workflow_name.to_s }
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/jiminy/reporting/ci_providers/circle_ci/workflow.rb', line 34

def failed?
  status == FAILED
end

#not_run?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/jiminy/reporting/ci_providers/circle_ci/workflow.rb', line 30

def not_run?
  status == NOT_RUN
end

#running?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/jiminy/reporting/ci_providers/circle_ci/workflow.rb', line 26

def running?
  status == RUNNING
end

#success?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/jiminy/reporting/ci_providers/circle_ci/workflow.rb', line 22

def success?
  status == SUCCESS
end