Module: CodesWholesale::Default

Defined in:
lib/codes_wholesale/default.rb

Constant Summary collapse

ENVIRONMENT =
'production'.freeze
API_VERSION =
'v1'.freeze
USER_AGENT =
"CodesWholesale Ruby Gem #{CodesWholesale::VERSION}".freeze

Class Method Summary collapse

Class Method Details

.api_versionObject



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

def api_version
  ENV['CODES_WHOLESALE_API_VERSION'] ||= API_VERSION
end

.client_idObject



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

def client_id
  ENV['CODES_WHOLESALE_CLIENT_ID']
end

.client_secretObject



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

def client_secret
  ENV['CODES_WHOLESALE_CLIENT_SECRET']
end

.environmentObject



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

def environment
  ENV['CODES_WHOLESALE_ENVIRONMENT'] ||= ENVIRONMENT
end

.optionsObject



10
11
12
# File 'lib/codes_wholesale/default.rb', line 10

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

.user_agentObject



30
31
32
# File 'lib/codes_wholesale/default.rb', line 30

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