class ThinkingSphinx::Callbacks
Attributes
instance[R]
Public Class Methods
callbacks(*methods)
click to toggle source
# File lib/thinking_sphinx/callbacks.rb, line 6 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 32 def initialize(instance) @instance = instance end
resume!()
click to toggle source
# File lib/thinking_sphinx/callbacks.rb, line 14 def self.resume! @suspended = false end
suspend() { || ... }
click to toggle source
# File lib/thinking_sphinx/callbacks.rb, line 18 def self.suspend(&block) suspend! yield resume! end
suspend!()
click to toggle source
# File lib/thinking_sphinx/callbacks.rb, line 24 def self.suspend! @suspended = true end
suspended?()
click to toggle source
# File lib/thinking_sphinx/callbacks.rb, line 28 def self.suspended? @suspended end