lib/strava/web/request.rb in strava-ruby-client-0.4.3 vs lib/strava/web/request.rb in strava-ruby-client-1.0.0
- old
+ new
@@ -23,20 +23,21 @@
def request(method, path, options)
options = options.dup if options.key?(:request) || options.key?(:endpoint)
root = options.delete(:endpoint) || endpoint
path = [root, path].join('/')
- response = connection.send(method) do |request|
+ http_response = connection.send(method) do |request|
case method
when :get, :delete
request.url(path, options)
when :post, :put
request.path = path
request.body = options unless options.empty?
end
request.options.merge!(options.delete(:request)) if options.key?(:request)
end
- response.body
+
+ Strava::Web::Response.new(http_response)
end
end
end
end