Class: Leadtune::Rest
- Inherits:
-
Object
- Object
- Leadtune::Rest
- Defined in:
- lib/leadtune/rest.rb
Overview
:nodoc:all
Constant Summary collapse
- PROSPECTS_PATH =
"/prospects"
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #delete(post_data) ⇒ Object
- #get(post_data) ⇒ Object
-
#initialize(config) ⇒ Rest
constructor
A new instance of Rest.
- #post(post_data) ⇒ Object
- #put(post_data) ⇒ Object
Constructor Details
#initialize(config) ⇒ Rest
Returns a new instance of Rest.
16 17 18 19 20 |
# File 'lib/leadtune/rest.rb', line 16 def initialize(config) @config = config @post_data = nil @response = {} end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
14 15 16 |
# File 'lib/leadtune/rest.rb', line 14 def response @response end |
Instance Method Details
#delete(post_data) ⇒ Object
43 44 45 46 47 48 |
# File 'lib/leadtune/rest.rb', line 43 def delete(post_data) @post_data = post_data curl = build_curl_easy_object_delete curl.http("DELETE") parse_response(curl.body_str) unless curl.body_str.empty? end |
#get(post_data) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/leadtune/rest.rb', line 22 def get(post_data) @post_data = post_data curl = build_curl_easy_object_get curl.http("GET") parse_response(curl.body_str) end |
#post(post_data) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/leadtune/rest.rb', line 29 def post(post_data) @post_data = post_data curl = build_curl_easy_object_post curl.http("POST") parse_response(curl.body_str) end |
#put(post_data) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/leadtune/rest.rb', line 36 def put(post_data) @post_data = post_data curl = build_curl_easy_object_put curl.http("PUT") parse_response(curl.body_str) end |