Module: CodewarsApi::RequestHelper

Includes:
HTTParty
Defined in:
lib/codewars_api/request_helper.rb

Class Method Summary collapse

Class Method Details

.add_api_key(request_options, api_key) ⇒ Object


8
9
10
11
12
# File 'lib/codewars_api/request_helper.rb', line 8

def self.add_api_key(request_options, api_key)
  request_options = request_options.dup
  request_options[:headers] = { 'Authorization' => api_key }
  request_options
end

.add_body_options(request_options, body_options) ⇒ Object


14
15
16
17
18
# File 'lib/codewars_api/request_helper.rb', line 14

def self.add_body_options(request_options, body_options)
  request_options = request_options.dup
  request_options[:body] = body_options
  request_options
end