Skip to content

Commit

Permalink
Merge pull request rest-client#398 from rest-client/ab-response-class
Browse files Browse the repository at this point in the history
Make the Response actually a class not a module.
  • Loading branch information
ab committed Jun 10, 2015
2 parents ae2efa4 + 0a9e096 commit dd97693
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/restclient/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -38,9 +38,8 @@ def inspect
"<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)
Expand Down

0 comments on commit dd97693

Please sign in to comment.