Class: LabClient::Pipeline

Inherits:
Klass show all
Includes:
ClassHelpers
Defined in:
lib/labclient/pipelines/pipeline.rb

Overview

Inspect Helper

Instance Attribute Summary

Attributes inherited from Klass

#client, #response

Instance Method Summary collapse

Methods included from ClassHelpers

#has?, #keys, #raw

Methods inherited from Klass

#collect_project_id, #collect_release_id, #collect_repository_id, date_time_attrs, #format_time?, #group_name, #help, #initialize, #klass, #to_json, #update_self, user_attrs, #verbose

Methods included from Docs

#desc, #doc, docs, #example, #group_name, #help, json, #markdown, #navigation, #option, #result, #subtitle, #title

Methods included from CurlHelper

#curl

Methods inherited from OpenStruct

#as_json, #keys

Constructor Details

This class inherits a constructor from LabClient::Klass

Instance Method Details

#cancelObject



21
22
23
24
# File 'lib/labclient/pipelines/pipeline.rb', line 21

def cancel
  project_id = collect_project_id
  update_self client.pipelines.cancel(project_id, id)
end

#deleteObject



26
27
28
29
# File 'lib/labclient/pipelines/pipeline.rb', line 26

def delete
  project_id = collect_project_id
  client.pipelines.delete(project_id, id)
end

#inspectObject



7
8
9
# File 'lib/labclient/pipelines/pipeline.rb', line 7

def inspect
  "#<Pipeline id: #{id}, ref: #{ref}, status: #{status}>"
end

#jobs(scope = nil) ⇒ Object



31
32
33
34
# File 'lib/labclient/pipelines/pipeline.rb', line 31

def jobs(scope = nil)
  project_id = collect_project_id
  client.jobs.pipeline(project_id, id, scope)
end

#retryObject



16
17
18
19
# File 'lib/labclient/pipelines/pipeline.rb', line 16

def retry
  project_id = collect_project_id
  client.pipelines.retry(project_id, id)
end

#variablesObject



11
12
13
14
# File 'lib/labclient/pipelines/pipeline.rb', line 11

def variables
  project_id = collect_project_id
  client.pipelines.variables(project_id, id)
end