Module: IdbusApi::Default

Extended by:
Api::DefaultOptions
Defined in:
lib/idbus_api/default.rb

Overview

Default configuration options for Client

Constant Summary collapse

API_ENDPOINT =

Default API endpoint

"https://api.idbus.com".freeze
API_VERSION =

Default API version

"v1".freeze
USER_AGENT =

Default User Agent header string

"Idbus API Ruby Gem #{IdbusApi::VERSION}".freeze

Class Method Summary collapse

Class Method Details

.access_tokenString

Default access token from ENV

Returns:

  • (String)


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

def access_token
  ENV['IDBUS_ACCESS_TOKEN']
end

.access_token_prefixString

Default access token prefix

Returns:

  • (String)


29
30
31
# File 'lib/idbus_api/default.rb', line 29

def access_token_prefix
  "Token"
end

.api_endpointString

Default API endpoint from ENV or API_ENDPOINT

Returns:

  • (String)


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

def api_endpoint
  ENV['IDBUS_API_ENDPOINT'] || API_ENDPOINT
end

.api_versionString

Default API version from ENV or API_VERSION

Returns:

  • (String)


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

def api_version
  ENV['IDBUS_API_VERSION'] || API_VERSION
end

.connection_optionsHash

Returns:

  • (Hash)


47
48
49
50
51
52
53
# File 'lib/idbus_api/default.rb', line 47

def connection_options
  {
    :headers => {
      :user_agent => user_agent
    }
  }
end

.user_agentString

Default User-Agent header string from ENV or USER_AGENT Default User-Agent header string from ENV or USER_AGENT

Returns:

  • (String)
  • (String)


59
60
61
# File 'lib/idbus_api/default.rb', line 59

def user_agent
  ENV['IDBUS_USER_AGENT'] || USER_AGENT
end