Class: Truepill::Request

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

Overview

Truepill Request class

Represents an authenticated request to the Truepill API.

Not used directly. RestfulResource inherits from this and implements the core, common methods used by the API.

Direct Known Subclasses

RestfulResource

Instance Method Summary collapse

Instance Method Details

#get(path) ⇒ Object Also known as: delete



20
21
22
23
24
25
# File 'lib/truepill/request.rb', line 20

def get(path)
  perform_checks(path)
  url = build_url(path)
  response = send_authenticated(__callee__, url)
  Response.new(response)
end

#post(path, data = {}) ⇒ Object Also known as: put, patch



28
29
30
31
32
33
# File 'lib/truepill/request.rb', line 28

def post(path, data = {})
  perform_checks(path)
  url = build_url(path)
  response = send_authenticated(__callee__, url, data)
  Response.new(response)
end