Class: ElasticSearch::Api::Hit
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- ElasticSearch::Api::Hit
- Defined in:
- lib/elasticsearch/client/hits.rb
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(hit) ⇒ Hit
constructor
A new instance of Hit.
Constructor Details
#initialize(hit) ⇒ Hit
Returns a new instance of Hit.
8 9 10 11 12 13 14 |
# File 'lib/elasticsearch/client/hits.rb', line 8 def initialize(hit) hit = hit.dup hit.merge!(hit["_source"]) if hit["_source"] hit["id"] ||= hit["_id"] super(hit) @table.freeze end |
Instance Method Details
#attributes ⇒ Object
16 17 18 |
# File 'lib/elasticsearch/client/hits.rb', line 16 def attributes @table end |