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 |
# 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) end |
Instance Method Details
#attributes ⇒ Object
15 16 17 |
# File 'lib/elasticsearch/client/hits.rb', line 15 def attributes @table end |