Class: WebCache::Response
- Inherits:
-
Object
- Object
- WebCache::Response
- Defined in:
- lib/webcache/response.rb
Instance Attribute Summary collapse
-
#base_uri ⇒ Object
Returns the value of attribute base_uri.
-
#code ⇒ Object
Returns the value of attribute code.
-
#content ⇒ Object
Returns the value of attribute content.
-
#error ⇒ Object
Returns the value of attribute error.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Response
Returns a new instance of Response.
5 6 7 8 9 10 |
# File 'lib/webcache/response.rb', line 5 def initialize(opts = {}) case opts when HTTP::Response then init_with_http_response opts when Hash then init_with_hash opts end end |
Instance Attribute Details
#base_uri ⇒ Object
Returns the value of attribute base_uri.
3 4 5 |
# File 'lib/webcache/response.rb', line 3 def base_uri @base_uri end |
#code ⇒ Object
Returns the value of attribute code.
3 4 5 |
# File 'lib/webcache/response.rb', line 3 def code @code end |
#content ⇒ Object
Returns the value of attribute content.
3 4 5 |
# File 'lib/webcache/response.rb', line 3 def content @content end |
#error ⇒ Object
Returns the value of attribute error.
3 4 5 |
# File 'lib/webcache/response.rb', line 3 def error @error end |
Instance Method Details
#success? ⇒ Boolean
16 17 18 |
# File 'lib/webcache/response.rb', line 16 def success? !error end |
#to_s ⇒ Object
12 13 14 |
# File 'lib/webcache/response.rb', line 12 def to_s content end |