Class: HTTP::Client::Response
- Inherits:
-
Object
- Object
- HTTP::Client::Response
- Defined in:
- lib/http/client.rb
Overview
Request
Instance Attribute Summary collapse
-
#last_effective_uri ⇒ Object
readonly
Returns the value of attribute last_effective_uri.
Instance Method Summary collapse
- #body ⇒ Object
- #code ⇒ Object
- #headers ⇒ Object
-
#initialize(response, last_effective_uri) ⇒ Response
constructor
A new instance of Response.
- #inspect ⇒ Object
Constructor Details
#initialize(response, last_effective_uri) ⇒ Response
Returns a new instance of Response.
256 257 258 259 |
# File 'lib/http/client.rb', line 256 def initialize response, last_effective_uri @response = response @last_effective_uri = last_effective_uri end |
Instance Attribute Details
#last_effective_uri ⇒ Object (readonly)
Returns the value of attribute last_effective_uri.
254 255 256 |
# File 'lib/http/client.rb', line 254 def last_effective_uri @last_effective_uri end |
Instance Method Details
#body ⇒ Object
269 270 271 |
# File 'lib/http/client.rb', line 269 def body @response.body end |
#code ⇒ Object
261 262 263 |
# File 'lib/http/client.rb', line 261 def code @response.code.to_i end |
#headers ⇒ Object
265 266 267 |
# File 'lib/http/client.rb', line 265 def headers @headers ||= Hash[@response.each_header.entries] end |
#inspect ⇒ Object
273 274 275 |
# File 'lib/http/client.rb', line 273 def inspect "#<#{self.class} @code=#{code} @last_effective_uri=#{last_effective_uri}>" end |