1
0
Fork 0
mirror of https://github.com/rest-client/rest-client.git synced 2022-11-09 13:49:40 -05:00

Merge pull request #398 from rest-client/ab-response-class

Make the Response actually a class not a module.
This commit is contained in:
Andy Brody 2015-06-09 18:40:38 -07:00
commit dd9769365c

View file

@ -2,7 +2,7 @@ module RestClient
# A Response from RestClient, you can access the response body, the code or the headers.
#
module Response
class Response < String
include AbstractResponse
@ -38,9 +38,8 @@ module RestClient
"<RestClient::Response #{code.inspect} #{body_truncated(10).inspect}>"
end
def self.create body, net_http_res, args, request
result = body || ''
result.extend Response
def self.create(body, net_http_res, args, request)
result = self.new(body || '')
result.response_set_vars(net_http_res, args, request)
fix_encoding(result)