Module: CTAAggregatorClient::API::Utilities

Included in:
Authenticator, Client
Defined in:
lib/cta_aggregator_client/api/utilities.rb

Instance Method Summary collapse

Instance Method Details

#api_keyObject



26
27
28
# File 'lib/cta_aggregator_client/api/utilities.rb', line 26

def api_key
  CTAAggregatorClient.configuration.api_key
end

#api_secretObject



30
31
32
# File 'lib/cta_aggregator_client/api/utilities.rb', line 30

def api_secret
  CTAAggregatorClient.configuration.api_secret
end

#api_versionObject



18
19
20
# File 'lib/cta_aggregator_client/api/utilities.rb', line 18

def api_version
  CTAAggregatorClient.configuration.api_version
end

#auth_urlObject



22
23
24
# File 'lib/cta_aggregator_client/api/utilities.rb', line 22

def auth_url
  "#{base_url}/#{api_version}/authentications"
end

#base_urlObject



14
15
16
# File 'lib/cta_aggregator_client/api/utilities.rb', line 14

def base_url
  CTAAggregatorClient.configuration.base_url
end

#default_headersObject



5
6
7
8
# File 'lib/cta_aggregator_client/api/utilities.rb', line 5

def default_headers
  { content_type: 'application/vnd.api+json',
    accept: 'application/vnd.api+json'}
end

#headers_with_auth_credsObject



10
11
12
# File 'lib/cta_aggregator_client/api/utilities.rb', line 10

def headers_with_auth_creds
  default_headers.merge(authorization: "#{api_key}:#{api_secret}")
end