Class: NetHttp2::Response
- Inherits:
-
Object
- Object
- NetHttp2::Response
- Defined in:
- lib/net-http2/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Response
constructor
A new instance of Response.
- #ok? ⇒ Boolean
- #status ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Response
Returns a new instance of Response.
6 7 8 9 |
# File 'lib/net-http2/response.rb', line 6 def initialize(={}) @headers = [:headers] @body = [:body] end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
4 5 6 |
# File 'lib/net-http2/response.rb', line 4 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
4 5 6 |
# File 'lib/net-http2/response.rb', line 4 def headers @headers end |
Instance Method Details
#ok? ⇒ Boolean
15 16 17 |
# File 'lib/net-http2/response.rb', line 15 def ok? status == '200' end |
#status ⇒ Object
11 12 13 |
# File 'lib/net-http2/response.rb', line 11 def status @headers[':status'] if @headers end |