Module: Lotohelp::Request

Extended by:
Request
Included in:
Request
Defined in:
lib/lotohelp/request.rb

Overview

Requests library

Class Method Summary collapse

Class Method Details

.get(path) ⇒ Hash

Constructing a GET request on the API

Returns:

  • (Hash)


11
12
13
14
15
16
17
18
# File 'lib/lotohelp/request.rb', line 11

def self.get(path)
  params = {
    user_token: Lotohelp::Config.auth_token,
    user_email: Lotohelp::Config.auth_email
  }

  self.do_req(path, :get, params)
end

.post(path, params) ⇒ Hash

Constructing a POST request on the API

Returns:

  • (Hash)


23
24
25
26
27
28
29
30
31
# File 'lib/lotohelp/request.rb', line 23

def self.post(path, params)
  auth_params = {
    user_token: Lotohelp::Config.auth_token,
    user_email: Lotohelp::Config.auth_email
  }
  request_params = auth_params.merge!(params)

  self.do_req(path, :post, request_params)
end