Class: Concourse::Client

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

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.



8
9
10
# File 'lib/concourse/client.rb', line 8

def initialize(options)
  @options = options
end

Instance Method Details

#==(other) ⇒ Object



24
25
26
# File 'lib/concourse/client.rb', line 24

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

#for_skymarshalObject



12
13
14
15
# File 'lib/concourse/client.rb', line 12

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

#get_infoObject



17
18
19
20
21
22
# File 'lib/concourse/client.rb', line 17

def get_info
  JSON.parse(
      Excon.get(Concourse::Urls.info_url(@options[:url]))
          .body,
      symbolize_names: true)
end