Class: ValrApi::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/valr_api.rb

Instance Method Summary collapse

Constructor Details

#initialize(api_key, api_secret) ⇒ Client

Returns a new instance of Client.



14
15
16
17
# File 'lib/valr_api.rb', line 14

def initialize(api_key, api_secret)
  @api_key = api_key
  @api_secret = api_secret
end

Instance Method Details

#delete(endpoint) ⇒ Object



29
30
31
32
# File 'lib/valr_api.rb', line 29

def delete(endpoint)
  sign_request("DELETE", endpoint)
  self.class.delete(endpoint, headers: headers)
end

#get(endpoint) ⇒ Object



19
20
21
22
# File 'lib/valr_api.rb', line 19

def get(endpoint)
  sign_request("GET", endpoint)
  self.class.get(endpoint, headers: headers)
end

#post(endpoint, options = {}) ⇒ Object



24
25
26
27
# File 'lib/valr_api.rb', line 24

def post(endpoint, options = {})
  sign_request("POST", endpoint, options)
  self.class.post(endpoint, { body: options, headers: headers })
end