Class: Net::HTTPExt::Response
- Defined in:
- lib/vex/base/net/http_ext.rb
Overview
This is a combination of a string (for the response body) and of a “hash” for the response header
Defined Under Namespace
Classes: Headers
Constant Summary
Constants inherited from String
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #code ⇒ Object
- #good? ⇒ Boolean
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
- #message ⇒ Object
Methods inherited from String
#constantize, #ends_with?, #iconv, #insp, #starts_with?
Constructor Details
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
40 41 42 |
# File 'lib/vex/base/net/http_ext.rb', line 40 def headers @headers end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
39 40 41 |
# File 'lib/vex/base/net/http_ext.rb', line 39 def response @response end |
Instance Method Details
#code ⇒ Object
42 |
# File 'lib/vex/base/net/http_ext.rb', line 42 def code; Integer(response.code); end |
#good? ⇒ Boolean
43 |
# File 'lib/vex/base/net/http_ext.rb', line 43 def good?; code >= 200 && code < 300; end |
#message ⇒ Object
44 |
# File 'lib/vex/base/net/http_ext.rb', line 44 def ; response.; end |