Class: GData::HTTP::Response
- Inherits:
-
Object
- Object
- GData::HTTP::Response
- Defined in:
- lib/gdata/http/response.rb
Overview
An extremely simple class to hold the values of an HTTP response.
Instance Attribute Summary collapse
-
#body ⇒ Object
The body of the HTTP response.
-
#headers ⇒ Object
The headers of the HTTP response.
-
#status_code ⇒ Object
The HTTP response code.
Instance Method Summary collapse
-
#to_xml ⇒ Object
Converts the response body into a REXML::Document.
Instance Attribute Details
#body ⇒ Object
The body of the HTTP response.
27 28 29 |
# File 'lib/gdata/http/response.rb', line 27 def body @body end |
#headers ⇒ Object
The headers of the HTTP response.
29 30 31 |
# File 'lib/gdata/http/response.rb', line 29 def headers @headers end |
#status_code ⇒ Object
The HTTP response code.
25 26 27 |
# File 'lib/gdata/http/response.rb', line 25 def status_code @status_code end |
Instance Method Details
#to_xml ⇒ Object
Converts the response body into a REXML::Document
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/gdata/http/response.rb', line 32 def to_xml if @body begin return REXML::Document.new(@body).root rescue raise GData::Client::Error, "Response body not XML." end else return nil end end |