Class: RediSearch::Search::Result
- Inherits:
-
Object
- Object
- RediSearch::Search::Result
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/redi_search/search/result.rb
Instance Method Summary collapse
- #count ⇒ Object
-
#initialize(search, count, documents) ⇒ Result
constructor
A new instance of Result.
- #inspect ⇒ Object
-
#pretty_print(printer) ⇒ Object
:nocov:.
- #size ⇒ Object
Constructor Details
#initialize(search, count, documents) ⇒ Result
9 10 11 12 13 |
# File 'lib/redi_search/search/result.rb', line 9 def initialize(search, count, documents) @count = count @search = search @results = parse_results(documents) end |
Instance Method Details
#count ⇒ Object
15 16 17 |
# File 'lib/redi_search/search/result.rb', line 15 def count @count || results.count end |
#inspect ⇒ Object
27 28 29 |
# File 'lib/redi_search/search/result.rb', line 27 def inspect results end |
#pretty_print(printer) ⇒ Object
:nocov:
32 33 34 |
# File 'lib/redi_search/search/result.rb', line 32 def pretty_print(printer) printer.pp(results) end |
#size ⇒ Object
19 20 21 |
# File 'lib/redi_search/search/result.rb', line 19 def size @count || results.size end |