Sha256: d7413c2f67c0eb4bde070355d17209dc46db6d63b29d26c259c8fec3085af791

Contents?: true

Size: 427 Bytes

Versions: 50

Compression:

Stored size: 427 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", nil => :json)
    end
  end
end

Version data entries

50 entries across 50 versions & 2 rubygems

Version Path
cfoundry-0.3.29 lib/cfoundry/client.rb
cfoundry-0.3.28 lib/cfoundry/client.rb
cfoundry-0.3.27 lib/cfoundry/client.rb
cfoundry-0.3.26 lib/cfoundry/client.rb
cfoundry-0.3.25 lib/cfoundry/client.rb
cfoundry-0.3.24 lib/cfoundry/client.rb
cfoundry-0.3.23 lib/cfoundry/client.rb
cfoundry-0.3.22 lib/cfoundry/client.rb
cfoundry-0.3.21 lib/cfoundry/client.rb
cfoundry-0.3.20 lib/cfoundry/client.rb
cfoundry-0.3.19 lib/cfoundry/client.rb
cfoundry-0.3.18 lib/cfoundry/client.rb
cfoundry-0.3.17 lib/cfoundry/client.rb
cfoundry-0.3.16 lib/cfoundry/client.rb
cfoundry-0.3.15 lib/cfoundry/client.rb
cfoundry-0.3.14 lib/cfoundry/client.rb
cfoundry-0.3.13 lib/cfoundry/client.rb
cfoundry-0.3.12 lib/cfoundry/client.rb
cfoundry-0.3.11 lib/cfoundry/client.rb
cfoundry-0.3.10 lib/cfoundry/client.rb