Sha256: dc84de6e7c7871da0726c7e270d9368269178692ae7aa14074839ed0c1ec9f2b

Contents?: true

Size: 552 Bytes

Versions: 3

Compression:

Stored size: 552 Bytes

Contents

module PlatformAPI
  # Get a client configured with the specified token.
  def self.connect( token)
    url = "https://:#{token}@api.heroku.com"
    default_headers = {'Accept' => 'application/vnd.heroku+json; version=3'}
    cache = Moneta.new(:File, dir: "#{Dir.home}/.heroku/platform-api")
    options = {default_headers: default_headers, cache: cache}
    schema_json = File.read("#{File.dirname(__FILE__)}/schema.json")
    schema = Heroics::Schema.new(MultiJson.decode(schema_json))
    Heroics.client_from_schema(schema, url, options)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
platform-api-0.0.5 lib/platform-api/client.rb
platform-api-0.0.4 lib/platform-api/client.rb
platform-api-0.0.3 lib/platform-api/client.rb