Skip to content

Commit

Permalink
Move log method from Response to AbstractResponse.
Browse files Browse the repository at this point in the history
  • Loading branch information
ab committed May 2, 2017
1 parent de5e268 commit 558621e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 5 additions & 0 deletions lib/restclient/abstract_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ def inspect
raise NotImplementedError.new('must override in subclass')
end

# Logger from the request, potentially nil.
def log
request.log
end

# HTTP status code
def code
@code ||= @net_http_res.code.to_i
Expand Down
4 changes: 0 additions & 4 deletions lib/restclient/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ def inspect
"<RestClient::Response #{code.inspect} #{body_truncated(10).inspect}>"
end

def log
request.log
end

def self.create(body, net_http_res, request, start_time=nil)
result = self.new(body || '')

Expand Down

0 comments on commit 558621e

Please sign in to comment.