class ThinkingSphinx::BatchedSearch

Attributes

searches[RW]

Public Class Methods

new() click to toggle source
# File lib/thinking_sphinx/batched_search.rb, line 4
def initialize
  @searches = []
end

Public Instance Methods

populate(middleware = ThinkingSphinx::Middlewares::DEFAULT) click to toggle source
# File lib/thinking_sphinx/batched_search.rb, line 8
def populate(middleware = ThinkingSphinx::Middlewares::DEFAULT)
  return if populated? || searches.empty?

  middleware.call contexts
  searches.each &:populated!

  @populated = true
end

Private Instance Methods

contexts() click to toggle source
# File lib/thinking_sphinx/batched_search.rb, line 19
def contexts
  searches.collect &:context
end
populated?() click to toggle source
# File lib/thinking_sphinx/batched_search.rb, line 23
def populated?
  @populated
end