Class: Net::HTTPResponse
- Inherits:
-
Object
- Object
- Net::HTTPResponse
- Defined in:
- lib/s33r/s33r_http.rb
Overview
Adds some convenience functions for checking response status.
Instance Attribute Summary collapse
-
#body ⇒ Object
writeonly
Sets the attribute body.
-
#success ⇒ Object
Returns the value of attribute success.
Instance Method Summary collapse
Instance Attribute Details
#body=(value) ⇒ Object (writeonly)
Sets the attribute body
8 9 10 |
# File 'lib/s33r/s33r_http.rb', line 8 def body=(value) @body = value end |
#success ⇒ Object
Returns the value of attribute success.
7 8 9 |
# File 'lib/s33r/s33r_http.rb', line 7 def success @success end |
Instance Method Details
#not_found ⇒ Object
18 19 20 |
# File 'lib/s33r/s33r_http.rb', line 18 def not_found code = '404' end |
#ok? ⇒ Boolean
10 11 12 |
# File 'lib/s33r/s33r_http.rb', line 10 def ok? success end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/s33r/s33r_http.rb', line 22 def to_s body end |