Sha256: 1f9dfc0260d44d0df9dd0347f10cc3c9a880cf5097d6b76d81669c5bd0b6a846

Contents?: true

Size: 413 Bytes

Versions: 19

Compression:

Stored size: 413 Bytes

Contents

class ThinkingSphinx::BatchedSearch
  attr_accessor :searches

  def initialize
    @searches = []
  end

  def populate(middleware = ThinkingSphinx::Middlewares::DEFAULT)
    return if populated? || searches.empty?

    middleware.call contexts
    searches.each &:populated!

    @populated = true
  end

  private

  def contexts
    searches.collect &:context
  end

  def populated?
    @populated
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
thinking-sphinx-3.4.2 lib/thinking_sphinx/batched_search.rb
thinking-sphinx-3.4.1 lib/thinking_sphinx/batched_search.rb
thinking-sphinx-3.4.0 lib/thinking_sphinx/batched_search.rb
thinking-sphinx-3.3.0 lib/thinking_sphinx/batched_search.rb
thinking-sphinx-3.2.0 lib/thinking_sphinx/batched_search.rb
thinking-sphinx-3.1.4 lib/thinking_sphinx/batched_search.rb
thinking-sphinx-3.1.3 lib/thinking_sphinx/batched_search.rb
thinking-sphinx-3.1.2 lib/thinking_sphinx/batched_search.rb
thinking-sphinx-3.1.1 lib/thinking_sphinx/batched_search.rb
thinking-sphinx-3.1.0 lib/thinking_sphinx/batched_search.rb
thinking-sphinx-3.0.6 lib/thinking_sphinx/batched_search.rb
thinking-sphinx-3.0.5 lib/thinking_sphinx/batched_search.rb
thinking-sphinx-3.0.4 lib/thinking_sphinx/batched_search.rb
thinking-sphinx-3.0.3 lib/thinking_sphinx/batched_search.rb
thinking-sphinx-3.0.2 lib/thinking_sphinx/batched_search.rb
thinking-sphinx-3.0.1 lib/thinking_sphinx/batched_search.rb
thinking-sphinx-3.0.0 lib/thinking_sphinx/batched_search.rb
thinking-sphinx-3.0.0.rc lib/thinking_sphinx/batched_search.rb
thinking-sphinx-3.0.0.pre lib/thinking_sphinx/batched_search.rb