Class: Curlyrest::CurlResponse
- Inherits:
-
Object
- Object
- Curlyrest::CurlResponse
- Includes:
- Net::HTTPHeader
- Defined in:
- lib/curlyrest.rb
Overview
class for a constructing a curl response
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#http_version ⇒ Object
readonly
Returns the value of attribute http_version.
-
#inflate ⇒ Object
Returns the value of attribute inflate.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(http_version, status, message = '') ⇒ CurlResponse
constructor
A new instance of CurlResponse.
- #unzip_body(gzip) ⇒ Object
Constructor Details
#initialize(http_version, status, message = '') ⇒ CurlResponse
Returns a new instance of CurlResponse.
12 13 14 15 16 17 18 19 |
# File 'lib/curlyrest.rb', line 12 def initialize(http_version, status, = '') = @http_version = http_version @code = status @body = '' @inflate = Zlib::Inflate.new(32 + Zlib::MAX_WBITS) initialize_http_header nil end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
11 12 13 |
# File 'lib/curlyrest.rb', line 11 def body @body end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
10 11 12 |
# File 'lib/curlyrest.rb', line 10 def code @code end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
10 11 12 |
# File 'lib/curlyrest.rb', line 10 def headers @headers end |
#http_version ⇒ Object (readonly)
Returns the value of attribute http_version.
10 11 12 |
# File 'lib/curlyrest.rb', line 10 def http_version @http_version end |
#inflate ⇒ Object
Returns the value of attribute inflate.
11 12 13 |
# File 'lib/curlyrest.rb', line 11 def inflate @inflate end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
10 11 12 |
# File 'lib/curlyrest.rb', line 10 def end |
Instance Method Details
#unzip_body(gzip) ⇒ Object
21 22 23 |
# File 'lib/curlyrest.rb', line 21 def unzip_body(gzip) @body = @inflate.inflate(gzip) end |