Class: CampaignHQ::API
- Inherits:
-
Object
- Object
- CampaignHQ::API
- Defined in:
- lib/campaign_h_q/api.rb,
lib/campaign_h_q/api/error.rb,
lib/campaign_h_q/api/response.rb,
lib/campaign_h_q/api/error/not_found.rb,
lib/campaign_h_q/api/error/unauthorized.rb,
lib/campaign_h_q/api/error/invalid_parameters.rb
Defined Under Namespace
Constant Summary collapse
- HOST =
'api.campaignhq.co'- PORT =
443- HEADERS =
{ 'Content-Type' => 'application/json' }.freeze
Instance Method Summary collapse
- #delete(path) ⇒ Object
- #get(path) ⇒ Object
-
#initialize(api_key) ⇒ API
constructor
A new instance of API.
- #patch(path, body = {}) ⇒ Object
- #post(path, body = {}) ⇒ Object
- #put(path, body = {}) ⇒ Object
Constructor Details
Instance Method Details
#delete(path) ⇒ Object
39 40 41 |
# File 'lib/campaign_h_q/api.rb', line 39 def delete(path) Response.new @http.delete(path, @auth_headers) end |
#get(path) ⇒ Object
23 24 25 |
# File 'lib/campaign_h_q/api.rb', line 23 def get(path) Response.new @http.get(path, @auth_headers) end |
#patch(path, body = {}) ⇒ Object
31 32 33 |
# File 'lib/campaign_h_q/api.rb', line 31 def patch(path, body = {}) Response.new @http.patch(path, body.to_json, @auth_headers) end |