Class: Concourse::Pipeline
- Inherits:
-
Object
- Object
- Concourse::Pipeline
- Defined in:
- lib/concourse/pipeline.rb
Overview
A pipeline belongs to a target A pipeline has many jobs
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #get(path = '') ⇒ Object
-
#initialize(target, info) ⇒ Pipeline
constructor
A new instance of Pipeline.
- #jobs ⇒ Object
- #to_s ⇒ Object
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
#name ⇒ Object (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 |
#jobs ⇒ Object
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_s ⇒ Object
32 33 34 |
# File 'lib/concourse/pipeline.rb', line 32 def to_s "#{self.class.name.split('::').last.downcase} #{name} of #{@target}" end |