Class: Esearch::Presenter::Hits
- Inherits:
-
Esearch::Presenter
- Object
- Esearch::Presenter
- Esearch::Presenter::Hits
- Includes:
- Enumerable
- Defined in:
- lib/esearch/presenter/hits.rb
Overview
Presenter for elasticsearch result hits
Instance Method Summary collapse
-
#each ⇒ self, Enumerator<Hit>
private
Enumerate contents.
-
#size ⇒ Fixnum
private
Return amount of hits in this request.
-
#total ⇒ Fixnum
private
Return total amount of hits in the query.
Instance Method Details
#each ⇒ self, Enumerator<Hit>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Enumerate contents
20 21 22 23 24 25 26 27 28 |
# File 'lib/esearch/presenter/hits.rb', line 20 def each return to_enum unless block_given? hits.each do |hit| yield Hit.new(hit) end self end |
#size ⇒ Fixnum
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return amount of hits in this request
36 37 38 |
# File 'lib/esearch/presenter/hits.rb', line 36 def size hits.size end |
#total ⇒ Fixnum
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return total amount of hits in the query
46 |
# File 'lib/esearch/presenter/hits.rb', line 46 expose_primitive('total') |