lib/homeflow/api/request.rb in homeflow_api-0.17.5 vs lib/homeflow/api/request.rb in homeflow_api-0.17.6
- old
+ new
@@ -1,10 +1,13 @@
module Homeflow
module API
YAML::ENGINE.yamler = "syck"
class Request
+ include HTTParty
+
+
attr_accessor :resource_class, :request_specification
def initialize(request_specification)
@request_specification = request_specification
end
@@ -35,18 +38,18 @@
log_line << "@request_specification:\n#{@request_specification.to_json}\n"
Homeflow::API.configuration.logger.info(log_line.join("\n"))
end
if request_specification.is_a? Query
- return (HTTParty.get(url, :query => query_params)).body
+ return (get(url, :query => query_params)).body
elsif request_specification.is_a? ResourceIdentifier
- return (HTTParty.get(url, :query => query_params)).body
+ return (get(url, :query => query_params)).body
elsif request_specification.is_a? Delete
- return (HTTParty.delete(url, :query => query_params)).body
+ return (delete(url, :query => query_params)).body
elsif request_specification.is_a? Put
- return (HTTParty.put(url, :query => query_params, :body => post_params)).body
+ return (put(url, :query => query_params, :body => post_params)).body
elsif request_specification.is_a? Post
- return (HTTParty.post(url, :query => query_params, :body => post_params)).body
+ return (post(url, :query => query_params, :body => post_params)).body
end
end
def constant_params