Class: Unfuzzle::Response
- Inherits:
-
Object
- Object
- Unfuzzle::Response
- Defined in:
- lib/unfuzzle/lib/unfuzzle/response.rb
Overview
Response
A simple wrapper around an HTTP response from the Unfuddle API
Instance Method Summary collapse
-
#body ⇒ Object
Raw body of the HTTP response.
-
#error? ⇒ Boolean
Was there an error produced as part of the request?.
-
#initialize(http_response) ⇒ Response
constructor
Create a new response from an HTTP response object.
Constructor Details
#initialize(http_response) ⇒ Response
Create a new response from an HTTP response object
10 11 12 |
# File 'lib/unfuzzle/lib/unfuzzle/response.rb', line 10 def initialize(http_response) @http_response = http_response end |
Instance Method Details
#body ⇒ Object
Raw body of the HTTP response
20 21 22 |
# File 'lib/unfuzzle/lib/unfuzzle/response.rb', line 20 def body @http_response.body end |
#error? ⇒ Boolean
Was there an error produced as part of the request?
15 16 17 |
# File 'lib/unfuzzle/lib/unfuzzle/response.rb', line 15 def error? !@http_response.is_a?(Net::HTTPSuccess) end |