Class: ElasticsearchHermes::Result::Base
- Inherits:
-
Object
- Object
- ElasticsearchHermes::Result::Base
- Defined in:
- lib/elasticsearch_hermes/result/base.rb
Instance Attribute Summary collapse
-
#hits ⇒ Object
readonly
Returns the value of attribute hits.
-
#shards ⇒ Object
readonly
Returns the value of attribute shards.
-
#timed_out ⇒ Object
readonly
Returns the value of attribute timed_out.
-
#took ⇒ Object
readonly
Returns the value of attribute took.
Instance Method Summary collapse
- #ids ⇒ Object
-
#initialize(took:, timed_out:, hits:, _shards:) ⇒ Base
constructor
A new instance of Base.
- #models ⇒ Object
Constructor Details
#initialize(took:, timed_out:, hits:, _shards:) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 |
# File 'lib/elasticsearch_hermes/result/base.rb', line 8 def initialize(took:, timed_out:, hits:, _shards:) @took = took @timed_out = timed_out @shards = _shards @hits = hits end |
Instance Attribute Details
#hits ⇒ Object (readonly)
Returns the value of attribute hits.
6 7 8 |
# File 'lib/elasticsearch_hermes/result/base.rb', line 6 def hits @hits end |
#shards ⇒ Object (readonly)
Returns the value of attribute shards.
6 7 8 |
# File 'lib/elasticsearch_hermes/result/base.rb', line 6 def shards @shards end |
#timed_out ⇒ Object (readonly)
Returns the value of attribute timed_out.
6 7 8 |
# File 'lib/elasticsearch_hermes/result/base.rb', line 6 def timed_out @timed_out end |
#took ⇒ Object (readonly)
Returns the value of attribute took.
6 7 8 |
# File 'lib/elasticsearch_hermes/result/base.rb', line 6 def took @took end |
Instance Method Details
#ids ⇒ Object
15 16 17 |
# File 'lib/elasticsearch_hermes/result/base.rb', line 15 def ids @ids ||= @hits['hits'].map { |hit| hit['_id'] } end |
#models ⇒ Object
19 20 21 |
# File 'lib/elasticsearch_hermes/result/base.rb', line 19 def models @models ||= '' end |