Class: Elasticsearch::Transport::Transport::Response
- Inherits:
-
Object
- Object
- Elasticsearch::Transport::Transport::Response
- Defined in:
- lib/elasticsearch/transport/transport/response.rb
Overview
Wraps the response from Elasticsearch.
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.
29 30 31 32 |
# File 'lib/elasticsearch/transport/transport/response.rb', line 29 def initialize(status, body, headers={}) @status, @body, @headers = status, body, headers @body = body.force_encoding('UTF-8') if body.respond_to?(:force_encoding) && !body.frozen? end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
24 25 26 |
# File 'lib/elasticsearch/transport/transport/response.rb', line 24 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
24 25 26 |
# File 'lib/elasticsearch/transport/transport/response.rb', line 24 def headers @headers end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
24 25 26 |
# File 'lib/elasticsearch/transport/transport/response.rb', line 24 def status @status end |