Module: PlatformAPI
- Defined in:
- lib/platform-api.rb,
lib/platform-api/client.rb,
lib/platform-api/version.rb
Overview
Ruby HTTP client for the Heroku API.
Defined Under Namespace
Classes: Account, AccountFeature, Addon, AddonService, App, AppFeature, AppSetup, AppTransfer, Build, BuildResult, Client, Collaborator, ConfigVar, Domain, Dyno, Formation, Key, LogDrain, LogSession, OauthAuthorization, OauthClient, OauthGrant, OauthToken, Organization, OrganizationApp, OrganizationAppCollaborator, OrganizationMember, Plan, RateLimit, Region, Release, SSLEndpoint, Slug, Stack
Constant Summary collapse
- VERSION =
'0.1.0'
Class Method Summary collapse
-
.connect(api_key, options = nil) ⇒ Client
Get a Client configured to use HTTP Basic authentication.
-
.connect_oauth(oauth_token, options = nil) ⇒ Client
Get a Client configured to use OAuth authentication.
-
.connect_token(token, options = nil) ⇒ Client
Get a Client configured to use Token authentication.
Class Method Details
.connect(api_key, options = nil) ⇒ Client
Get a Client configured to use HTTP Basic authentication.
20 21 22 23 24 25 26 |
# File 'lib/platform-api/client.rb', line 20 def self.connect(api_key, =nil) = () puts "OPTIONS", url = "https://:#{api_key}@#{[:host]}" client = Heroics.client_from_schema(SCHEMA, url, ) Client.new(client) end |
.connect_oauth(oauth_token, options = nil) ⇒ Client
Get a Client configured to use OAuth authentication.
36 37 38 39 40 41 |
# File 'lib/platform-api/client.rb', line 36 def self.connect_oauth(oauth_token, =nil) = () url = "https://api.heroku.com" client = Heroics.oauth_client_from_schema(oauth_token, SCHEMA, url, ) Client.new(client) end |
.connect_token(token, options = nil) ⇒ Client
Get a Client configured to use Token authentication.
51 52 53 54 55 56 |
# File 'lib/platform-api/client.rb', line 51 def self.connect_token(token, =nil) = () url = "https://api.heroku.com" client = Heroics.token_client_from_schema(token, SCHEMA, url, ) Client.new(client) end |