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.



10
11
12
# File 'lib/concourse/client.rb', line 10

def initialize(options)
  @options = options
end

Instance Method Details

#==(other) ⇒ Object

rubocop:enable Naming/AccessorMethodName



30
31
32
# File 'lib/concourse/client.rb', line 30

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

#for_skymarshalObject



14
15
16
17
18
# File 'lib/concourse/client.rb', line 14

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

#get_infoObject

rubocop:disable Naming/AccessorMethodName



21
22
23
24
25
26
27
# File 'lib/concourse/client.rb', line 21

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