Module: GogoKit::Default

Defined in:
lib/gogokit/default.rb

Overview

Default configuration options for Client

Constant Summary collapse

API_ROOT_ENDPOINTS =

Default API root endpoints

{
  production: 'https://api.viagogo.net/v2'.freeze,
  sandbox: 'https://sandbox.api.viagogo.net/v2'.freeze
}.freeze
OAUTH_TOKEN_ENDPOINTS =

Default OAuth token endpoints

{
  production: 'https://account.viagogo.com/oauth2/token'.freeze,
  sandbox: 'https://sandbox.account.viagogo.com/oauth2/token'.freeze
}.freeze
AUTHORIZATION_ENDPOINTS =

Default Authorize endpoints

{
  production: 'https://account.viagogo.com/authorize'.freeze,
  sandbox: 'https://sandbox.account.viagogo.com/authorize'.freeze
}.freeze

Class Method Summary collapse

Class Method Details

.access_tokenObject



31
32
33
# File 'lib/gogokit/default.rb', line 31

def access_token
  ENV['GOGOKIT_ACCESS_TOKEN']
end

.api_environmentObject



35
36
37
38
# File 'lib/gogokit/default.rb', line 35

def api_environment
  env_api_environment = ENV['GOGOKIT_API_ENVIRONMENT']
  env_api_environment.nil? ? :production : env_api_environment.to_sym
end

.api_root_endpointObject



40
41
42
43
# File 'lib/gogokit/default.rb', line 40

def api_root_endpoint
  ENV['GOGOKIT_API_ROOT_ENDPOINT'] ||
    GogoKit::Default::API_ROOT_ENDPOINTS[api_environment]
end

.authorization_endpointObject



50
51
52
53
# File 'lib/gogokit/default.rb', line 50

def authorization_endpoint
  ENV['GOGOKIT_AUTHORIZATION_ENDPOINT'] ||
    GogoKit::Default::AUTHORIZATION_ENDPOINTS[api_environment]
end

.client_idObject



23
24
25
# File 'lib/gogokit/default.rb', line 23

def client_id
  ENV['GOGOKIT_CLIENT_ID']
end

.client_secretObject



27
28
29
# File 'lib/gogokit/default.rb', line 27

def client_secret
  ENV['GOGOKIT_CLIENT_SECRET']
end

.oauth_token_endpointObject



45
46
47
48
# File 'lib/gogokit/default.rb', line 45

def oauth_token_endpoint
  ENV['GOGOKIT_OAUTH_TOKEN_ENDPOINT'] ||
    GogoKit::Default::OAUTH_TOKEN_ENDPOINTS[api_environment]
end