Module: CTAAggregatorClient::API::Utilities
- Included in:
- Authenticator, Client
- Defined in:
- lib/cta_aggregator_client/api/utilities.rb
Instance Method Summary collapse
- #api_key ⇒ Object
- #api_secret ⇒ Object
- #api_version ⇒ Object
- #auth_url ⇒ Object
- #base_url ⇒ Object
- #default_headers ⇒ Object
- #headers_with_auth_creds ⇒ Object
Instance Method Details
#api_key ⇒ Object
26 27 28 |
# File 'lib/cta_aggregator_client/api/utilities.rb', line 26 def api_key CTAAggregatorClient.configuration.api_key end |
#api_secret ⇒ Object
30 31 32 |
# File 'lib/cta_aggregator_client/api/utilities.rb', line 30 def api_secret CTAAggregatorClient.configuration.api_secret end |
#api_version ⇒ Object
18 19 20 |
# File 'lib/cta_aggregator_client/api/utilities.rb', line 18 def api_version CTAAggregatorClient.configuration.api_version end |
#auth_url ⇒ Object
22 23 24 |
# File 'lib/cta_aggregator_client/api/utilities.rb', line 22 def auth_url "#{base_url}/#{api_version}/authentications" end |
#base_url ⇒ Object
14 15 16 |
# File 'lib/cta_aggregator_client/api/utilities.rb', line 14 def base_url CTAAggregatorClient.configuration.base_url end |
#default_headers ⇒ Object
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_creds ⇒ Object
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 |