Class: Gazette::Response::Success
- Inherits:
-
Gazette::Response
- Object
- Gazette::Response
- Gazette::Response::Success
- Defined in:
- lib/gazette/response/success.rb
Overview
Successful response from the Instapaper API
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
The body returned by the Instapaper API.
-
#content_location ⇒ Object
readonly
Final saved URL of the content returned from the Instapaper API.
-
#instapaper_title ⇒ Object
readonly
Saved title of the content returned from the Instapaper API.
Instance Method Summary collapse
-
#initialize(response) ⇒ Success
constructor
Create a new Success object out of a net/http response.
Constructor Details
#initialize(response) ⇒ Success
Create a new Success object out of a net/http response.
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/gazette/response/success.rb', line 18 def initialize(response) unless response.is_a?(Net::HTTPResponse) # Require a net/http response object raise ArgumentError.new("Argument must be a Net::HTTPResponse object") end # Build our ivars from the response and headers @body = response.body @content_location = response.header['Content-Location'] @instapaper_title = response.header['X-Instapaper-Title'] end |
Instance Attribute Details
#body ⇒ Object (readonly)
The body returned by the Instapaper API
15 16 17 |
# File 'lib/gazette/response/success.rb', line 15 def body @body end |
#content_location ⇒ Object (readonly)
Final saved URL of the content returned from the Instapaper API.
9 10 11 |
# File 'lib/gazette/response/success.rb', line 9 def content_location @content_location end |
#instapaper_title ⇒ Object (readonly)
Saved title of the content returned from the Instapaper API.
12 13 14 |
# File 'lib/gazette/response/success.rb', line 12 def instapaper_title @instapaper_title end |