Class: Concourse::Target
- Inherits:
-
Object
- Object
- Concourse::Target
- Defined in:
- lib/concourse/target.rb
Overview
A target has many pipelines
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #get(path = '') ⇒ Object
-
#initialize(client, name = nil) ⇒ Target
constructor
A new instance of Target.
- #pipelines ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(client, name = nil) ⇒ Target
Returns a new instance of Target.
15 16 17 18 |
# File 'lib/concourse/target.rb', line 15 def initialize(client, name = nil) @client = client @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
13 14 15 |
# File 'lib/concourse/target.rb', line 13 def name @name end |
Instance Method Details
#get(path = '') ⇒ Object
26 27 28 |
# File 'lib/concourse/target.rb', line 26 def get(path = '') @client.get('pipelines' + path) end |
#pipelines ⇒ Object
20 21 22 23 24 |
# File 'lib/concourse/target.rb', line 20 def pipelines JSON.parse(get).map do |json| Pipeline.new(self, json) end end |
#to_s ⇒ Object
30 31 32 |
# File 'lib/concourse/target.rb', line 30 def to_s "#{self.class.name.split('::').last.downcase} #{name}" end |