Sha256: 591765ff6390b7ff57a7f413ee0f1338ebada4cfad66545a8d7e43d8e7e03ead

Contents?: true

Size: 553 Bytes

Versions: 1

Compression:

Stored size: 553 Bytes

Contents

# frozen_string_literal: true

require 'uri'
require 'json'
require 'open-uri'
require 'net/https'

module Concourse
  #
  # A target has many pipelines
  #
  class Target
    attr_reader :name

    def initialize(client, name = nil)
      @client = client
      @name = name
    end

    def pipelines
      JSON.parse(get).map do |json|
        Pipeline.new(self, json)
      end
    end

    def get(path = '')
      @client.get('pipelines' + path)
    end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bitbar-concourse-1.1 lib/concourse/target.rb