Module: PUBG::Default

Defined in:
lib/pubg/default.rb

Overview

DEfault configuration options for Client

Constant Summary collapse

API_ENDPOINT =

Default API Endpoint

'https://api.playbattlegrounds.com'.freeze
REGION =

Default region

'xbox-na'.freeze
DEFAULT_MEDIA_TYPE =

Default media type

'application/vnd.api+json'.freeze

Class Method Summary collapse

Class Method Details

.access_tokenObject



22
23
24
# File 'lib/pubg/default.rb', line 22

def access_token
  ENV['PUBG_ACCESS_TOKEN']
end

.api_endpointObject



18
19
20
# File 'lib/pubg/default.rb', line 18

def api_endpoint
  API_ENDPOINT
end

.connection_optionsObject



30
31
32
33
34
35
36
# File 'lib/pubg/default.rb', line 30

def connection_options
  {
    headers: {
      accept: DEFAULT_MEDIA_TYPE
    }
  }
end

.optionsObject



14
15
16
# File 'lib/pubg/default.rb', line 14

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

.regionObject



26
27
28
# File 'lib/pubg/default.rb', line 26

def region
  ENV['PUBG_REGION'] || REGION
end