Sha256: db4b33db15c57ead4c92a9fce7b54cc04facb3c161dd2b158dc1ae1d7904f57f

Contents?: true

Size: 650 Bytes

Versions: 1

Compression:

Stored size: 650 Bytes

Contents

module ThinkingSphinx::Deltas
  def self.config
    ThinkingSphinx::Configuration.instance
  end
  def self.processor_for(delta)
    case delta
    when TrueClass
      ThinkingSphinx::Deltas::DefaultDelta
    when Class
      delta
    else
      nil
    end
  end

  def self.resume!
    @suspended = false
  end

  def self.suspend(reference, &block)
    suspend!
    yield
    resume!

    config.indices_for_references(reference).each do |index|
      index.delta_processor.index index
    end
  end

  def self.suspend!
    @suspended = true
  end

  def self.suspended?
    @suspended
  end
end

require 'thinking_sphinx/deltas/default_delta'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
thinking-sphinx-3.0.0.pre lib/thinking_sphinx/deltas.rb