Module: Unleashed::Default

Defined in:
lib/unleashed/default.rb

Overview

Default configuration options for Client

Constant Summary collapse

API_DOMAIN =

Default API domain

'api.unleashedsoftware.com'.freeze
CLIENT_TYPE_HEADER =

Default client_type_header

'API-Sandbox'.freeze

Class Method Summary collapse

Class Method Details

.api_domainString

Default API domain from ENV or API_DOMAIN.

Returns:

  • (String)


20
21
22
# File 'lib/unleashed/default.rb', line 20

def api_domain
  ENV['UNLEASHED_API_DOMAIN'] || API_DOMAIN
end

.api_idString

Default api_id from ENV.

Returns:

  • (String)


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

def api_id
  ENV['UNLEASHED_API_ID']
end

.api_keyString

Default api_key from ENV.

Returns:

  • (String)


34
35
36
# File 'lib/unleashed/default.rb', line 34

def api_key
  ENV['UNLEASHED_API_KEY']
end

.client_type_headerString

Default client_type_header from ENV.

Returns:

  • (String)


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

def client_type_header
  ENV['UNLEASHED_CLIENT_TYPE_HEADER'] || CLIENT_TYPE_HEADER
end

.errors_formatString

Default errors_format from ENV.

Returns:

  • (String)


48
49
50
# File 'lib/unleashed/default.rb', line 48

def errors_format
  ENV['UNLEASHED_ERRORS_FORMAT'] || 'processed'
end

.optionsHash

Configuration options.

Returns:

  • (Hash)


13
14
15
# File 'lib/unleashed/default.rb', line 13

def options
  Hash[Unleashed::Configurable.keys.map { |key| [key, send(key)] }]
end