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:
commit
dd9769365c
1 changed files with 3 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue