Class: ThinkingSphinx::BatchedSearch
- Inherits:
-
Object
- Object
- ThinkingSphinx::BatchedSearch
- Defined in:
- lib/thinking_sphinx/batched_search.rb
Instance Attribute Summary collapse
-
#searches ⇒ Object
Returns the value of attribute searches.
Instance Method Summary collapse
-
#initialize ⇒ BatchedSearch
constructor
A new instance of BatchedSearch.
- #populate(middleware = ThinkingSphinx::Middlewares::DEFAULT) ⇒ Object
Constructor Details
#initialize ⇒ BatchedSearch
Returns a new instance of BatchedSearch.
6 7 8 |
# File 'lib/thinking_sphinx/batched_search.rb', line 6 def initialize @searches = [] end |
Instance Attribute Details
#searches ⇒ Object
Returns the value of attribute searches.
4 5 6 |
# File 'lib/thinking_sphinx/batched_search.rb', line 4 def searches @searches end |
Instance Method Details
#populate(middleware = ThinkingSphinx::Middlewares::DEFAULT) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/thinking_sphinx/batched_search.rb', line 10 def populate(middleware = ThinkingSphinx::Middlewares::DEFAULT) return if populated? || searches.empty? middleware.call contexts searches.each &:populated! @populated = true end |