Module: ThinkingSphinx::Deltas

Defined in:
lib/thinking_sphinx/deltas.rb

Defined Under Namespace

Classes: DefaultDelta, DeleteJob, IndexJob

Class Method Summary (collapse)

Class Method Details

+ (Object) config



2
3
4
# File 'lib/thinking_sphinx/deltas.rb', line 2

def self.config
  ThinkingSphinx::Configuration.instance
end

+ (Object) processor_for(delta)



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/thinking_sphinx/deltas.rb', line 6

def self.processor_for(delta)
  case delta
  when TrueClass
    ThinkingSphinx::Deltas::DefaultDelta
  when Class
    delta
  when String
    delta.constantize
  else
    nil
  end
end

+ (Object) resume!



19
20
21
# File 'lib/thinking_sphinx/deltas.rb', line 19

def self.resume!
  @suspended = false
end

+ (Object) suspend(reference, &block)



23
24
25
26
27
28
29
30
31
# File 'lib/thinking_sphinx/deltas.rb', line 23

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

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

+ (Object) suspend!



33
34
35
# File 'lib/thinking_sphinx/deltas.rb', line 33

def self.suspend!
  @suspended = true
end

+ (Boolean) suspended?

Returns:

  • (Boolean)


37
38
39
# File 'lib/thinking_sphinx/deltas.rb', line 37

def self.suspended?
  @suspended
end