Class: Blitz::Curl::Sprint::Response
- Inherits:
-
Object
- Object
- Blitz::Curl::Sprint::Response
- Defined in:
- lib/blitz/curl/sprint.rb
Overview
Represents the response object generated by the sprint. Contains all of the headers and the response payload, if any.
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
The response content, if any.
-
#headers ⇒ Object
readonly
All of the response headers (as a Hash of name/value pairs).
-
#line ⇒ Object
readonly
The entire response line (HTTP/1.1 200 Okay, for example).
-
#message ⇒ Object
readonly
The message in the response line.
-
#status ⇒ Object
readonly
The response status.
Instance Method Summary collapse
-
#initialize(json) ⇒ Response
constructor
:nodoc:.
Constructor Details
#initialize(json) ⇒ Response
:nodoc:
52 53 54 55 56 57 58 |
# File 'lib/blitz/curl/sprint.rb', line 52 def initialize json # :nodoc: @line = json['line'] @status = json['status'] @message = json['message'] @content = json['content'].unpack('m')[0] @headers = json['headers'] end |
Instance Attribute Details
#content ⇒ Object (readonly)
The response content, if any
50 51 52 |
# File 'lib/blitz/curl/sprint.rb', line 50 def content @content end |
#headers ⇒ Object (readonly)
All of the response headers (as a Hash of name/value pairs)
47 48 49 |
# File 'lib/blitz/curl/sprint.rb', line 47 def headers @headers end |
#line ⇒ Object (readonly)
The entire response line (HTTP/1.1 200 Okay, for example)
38 39 40 |
# File 'lib/blitz/curl/sprint.rb', line 38 def line @line end |
#message ⇒ Object (readonly)
The message in the response line
44 45 46 |
# File 'lib/blitz/curl/sprint.rb', line 44 def @message end |
#status ⇒ Object (readonly)
The response status
41 42 43 |
# File 'lib/blitz/curl/sprint.rb', line 41 def status @status end |