Sha256: 123cde9dceb298c5e09cb1409f35fa609b3fc5183387092f8ff1a7326e95742a

Contents?: true

Size: 431 Bytes

Versions: 15

Compression:

Stored size: 431 Bytes

Contents

require "cfoundry/baseclient"

require "cfoundry/v1/client"
require "cfoundry/v2/client"

module CFoundry
  class Client < BaseClient
    def self.new(*args)
      target, _ = args

      base = super(target)

      case base.info[:version]
      when 2
        CFoundry::V2::Client.new(*args)
      else
        CFoundry::V1::Client.new(*args)
      end
    end

    def info
      get("info", :accept => :json)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
cfoundry-0.3.61 lib/cfoundry/client.rb
cfoundry-0.3.60 lib/cfoundry/client.rb
cfoundry-0.3.59 lib/cfoundry/client.rb
cfoundry-0.3.58 lib/cfoundry/client.rb
cfoundry-0.3.57 lib/cfoundry/client.rb
cfoundry-0.3.56 lib/cfoundry/client.rb
cfoundry-0.3.55 lib/cfoundry/client.rb
cfoundry-0.3.54 lib/cfoundry/client.rb
cfoundry-0.3.53 lib/cfoundry/client.rb
cfoundry-0.3.52 lib/cfoundry/client.rb
cfoundry-0.3.51 lib/cfoundry/client.rb
cfoundry-0.3.50 lib/cfoundry/client.rb
cfoundry-0.3.49 lib/cfoundry/client.rb
cfoundry-0.3.48 lib/cfoundry/client.rb
cfoundry-0.3.47 lib/cfoundry/client.rb