Module: BWStatusBoardAPI::Default

Defined in:
lib/bw_status_board_api/default.rb

Overview

Default module

Constant Summary collapse

ADAPTER =
Faraday.default_adapter
API_ENDPOINT =
'http://argus:3000/api/'
USER_AGENT =
"BWStatusBoardAPI Ruby Gem #{BWStatusBoardAPI::VERSION}".freeze

Class Method Summary collapse

Class Method Details

.adapterObject



21
22
23
# File 'lib/bw_status_board_api/default.rb', line 21

def adapter
  ENV['BWStatusBoardAPI_ADAPTER'] || ADAPTER
end

.api_endpointObject



25
26
27
# File 'lib/bw_status_board_api/default.rb', line 25

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

.connection_optionsObject



29
30
31
32
33
34
35
36
37
38
# File 'lib/bw_status_board_api/default.rb', line 29

def connection_options
  {
    headers: {
      user_agent: user_agent
    },
    request: {
      params_encoder: Faraday::FlatParamsEncoder
    }
  }
end

.debugObject



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

def debug
  ENV['BWStatusBoardAPI_DEBUG'] || false
end

.loggerObject



44
45
46
# File 'lib/bw_status_board_api/default.rb', line 44

def logger
  nil
end

.optionsObject



17
18
19
# File 'lib/bw_status_board_api/default.rb', line 17

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

.performanceObject



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

def performance
  Allotment.results
end

.user_agentObject



52
53
54
# File 'lib/bw_status_board_api/default.rb', line 52

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

.verify_sslObject



56
57
58
# File 'lib/bw_status_board_api/default.rb', line 56

def verify_ssl
  ENV['BWStatusBoardAPI_VERIFY_SSL'] || false
end