Class: Papertrail::HttpResponse

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/papertrail/http_client.rb

Overview

Used because Net::HTTPOK in Ruby 1.8 hasn’t method body=

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ HttpResponse

Returns a new instance of HttpResponse.



11
12
13
# File 'lib/papertrail/http_client.rb', line 11

def initialize(response)
  super(response)
end

Instance Method Details

#bodyObject



15
16
17
# File 'lib/papertrail/http_client.rb', line 15

def body
  @body ||= Papertrail::OkJson.decode(__getobj__.body.dup.force_encoding('UTF-8'))
end