Class: Concourse::Pipeline

Inherits:
Object
  • Object
show all
Defined in:
lib/concourse/pipeline.rb

Overview

A pipeline belongs to a target A pipeline has many jobs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target, info) ⇒ Pipeline

Returns a new instance of Pipeline.



13
14
15
16
# File 'lib/concourse/pipeline.rb', line 13

def initialize(target, info)
  @target = target
  @info = info
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/concourse/pipeline.rb', line 11

def name
  @name
end

Instance Method Details

#get(path = '') ⇒ Object



28
29
30
# File 'lib/concourse/pipeline.rb', line 28

def get(path = '')
  @target.get("/#{CGI.escape(name)}/jobs#{path}")
end

#jobsObject



22
23
24
25
26
# File 'lib/concourse/pipeline.rb', line 22

def jobs
  JSON.parse(get).map do |job|
    Job.new(self, job)
  end
end

#to_sObject



32
33
34
# File 'lib/concourse/pipeline.rb', line 32

def to_s
  "#{self.class.name.split('::').last.downcase} #{name} of #{@target}"
end