Class: Papertrail::HttpResponse
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Papertrail::HttpResponse
- Defined in:
- lib/papertrail/http_client.rb
Overview
Used because Net::HTTPOK in Ruby 1.8 has no body= method
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(response) ⇒ HttpResponse
constructor
A new instance of HttpResponse.
Constructor Details
#initialize(response) ⇒ HttpResponse
Returns a new instance of HttpResponse.
9 10 11 |
# File 'lib/papertrail/http_client.rb', line 9 def initialize(response) super(response) end |
Instance Method Details
#body ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/papertrail/http_client.rb', line 17 def body if __getobj__.body.respond_to?(:force_encoding) @body ||= Papertrail::OkJson.decode(__getobj__.body.dup.force_encoding('UTF-8')) else @body ||= Papertrail::OkJson.decode(__getobj__.body.dup) end end |