Sha256: cc2c15eae2426e3f060dc7939995969ea7e2700b7dc91669a760d0622570bf38

Contents?: true

Size: 736 Bytes

Versions: 31

Compression:

Stored size: 736 Bytes

Contents

# frozen_string_literal: true

require 'excon'
require 'json'

require 'concourse/sub_clients'

module Concourse
  class Client
    def initialize(options)
      @options = options
    end

    def for_skymarshal
      Concourse::SubClients::SkymarshalClient.new(
        @options.merge(version: get_info[:version])
      )
    end

    # rubocop:disable Naming/AccessorMethodName
    def get_info
      JSON.parse(
        Excon.get(Concourse::Urls.info_url(@options[:url]))
            .body,
        symbolize_names: true
      )
    end
    # rubocop:enable Naming/AccessorMethodName

    def ==(other)
      other.class == self.class && other.state == state
    end

    protected

    def state
      [@options]
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
concourse.rb-0.6.0.pre.10 lib/concourse/client.rb
concourse.rb-0.6.0.pre.9 lib/concourse/client.rb
concourse.rb-0.6.0.pre.8 lib/concourse/client.rb
concourse.rb-0.6.0.pre.7 lib/concourse/client.rb
concourse.rb-0.6.0.pre.6 lib/concourse/client.rb
concourse.rb-0.6.0.pre.5 lib/concourse/client.rb
concourse.rb-0.6.0.pre.4 lib/concourse/client.rb
concourse.rb-0.6.0.pre.3 lib/concourse/client.rb
concourse.rb-0.6.0.pre.2 lib/concourse/client.rb
concourse.rb-0.6.0.pre.1 lib/concourse/client.rb
concourse.rb-0.5.0 lib/concourse/client.rb
concourse.rb-0.5.0.pre.20 lib/concourse/client.rb
concourse.rb-0.5.0.pre.19 lib/concourse/client.rb
concourse.rb-0.5.0.pre.18 lib/concourse/client.rb
concourse.rb-0.5.0.pre.17 lib/concourse/client.rb
concourse.rb-0.5.0.pre.16 lib/concourse/client.rb
concourse.rb-0.5.0.pre.15 lib/concourse/client.rb
concourse.rb-0.5.0.pre.14 lib/concourse/client.rb
concourse.rb-0.5.0.pre.13 lib/concourse/client.rb
concourse.rb-0.5.0.pre.12 lib/concourse/client.rb