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(&block) ⇒ 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(&block) ⇒ 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
18 19 20 21 22 23 24 25 26 |
# File 'lib/esearch/presenter/hits.rb', line 18 def each(&block) 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
34 35 36 |
# File 'lib/esearch/presenter/hits.rb', line 34 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
44 |
# File 'lib/esearch/presenter/hits.rb', line 44 expose_primitive('total') |