class ThinkingSphinx::Callbacks

Attributes

instance[R]

Public Class Methods

callbacks(*methods) click to toggle source
# File lib/thinking_sphinx/callbacks.rb, line 4
def self.callbacks(*methods)
  mod = Module.new
  methods.each do |method|
    mod.send(:define_method, method) { |instance| new(instance).send(method) }
  end
  extend mod
end
new(instance) click to toggle source
# File lib/thinking_sphinx/callbacks.rb, line 30
def initialize(instance)
  @instance = instance
end
resume!() click to toggle source
# File lib/thinking_sphinx/callbacks.rb, line 12
def self.resume!
  @suspended = false
end
suspend() { || ... } click to toggle source
# File lib/thinking_sphinx/callbacks.rb, line 16
def self.suspend(&block)
  suspend!
  yield
  resume!
end
suspend!() click to toggle source
# File lib/thinking_sphinx/callbacks.rb, line 22
def self.suspend!
  @suspended = true
end
suspended?() click to toggle source
# File lib/thinking_sphinx/callbacks.rb, line 26
def self.suspended?
  @suspended
end