Module: Wonkavision::Plugins::Callbacks::InstanceMethods

Defined in:
lib/wonkavision/plugins/callbacks.rb

Instance Method Summary collapse

Instance Method Details

#handle_event_with_callbacksObject



47
48
49
50
51
52
# File 'lib/wonkavision/plugins/callbacks.rb', line 47

def handle_event_with_callbacks
  ctx = @wonkavision_event_context
  run_wonkavision_callbacks(:before_event)
  handle_event_without_callbacks
  run_wonkavision_callbacks(:after_event)
end

#run_wonkavision_callbacks(kind, options = {}, &block) ⇒ Object



54
55
56
57
58
# File 'lib/wonkavision/plugins/callbacks.rb', line 54

def run_wonkavision_callbacks(kind, options={}, &block)
  callback_chain_method = "#{kind}_callback_chain"
  return unless self.class.respond_to?(callback_chain_method)
  self.class.send(callback_chain_method).run(self, options, &block)          
end