Class: OpenSearch::Transport::Transport::Response
- Inherits:
-
Object
- Object
- OpenSearch::Transport::Transport::Response
- Defined in:
- lib/opensearch/transport/transport/response.rb
Overview
Wraps the response from OpenSearch.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status, body, headers = {}) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(status, body, headers = {}) ⇒ Response
Returns a new instance of Response.
38 39 40 41 42 43 |
# File 'lib/opensearch/transport/transport/response.rb', line 38 def initialize(status, body, headers = {}) @status = status @body = body @headers = headers @body = body.force_encoding('UTF-8') if body.respond_to?(:force_encoding) && body.encoding != Encoding::UTF_8 end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
33 34 35 |
# File 'lib/opensearch/transport/transport/response.rb', line 33 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
33 34 35 |
# File 'lib/opensearch/transport/transport/response.rb', line 33 def headers @headers end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
33 34 35 |
# File 'lib/opensearch/transport/transport/response.rb', line 33 def status @status end |