module Controll::Enabler::Notify

Public Instance Methods

events() click to toggle source

event stack

# File lib/controll/enabler/notify.rb, line 25
def events
  @events ||= Controll::Events.new
end
main_event() click to toggle source
# File lib/controll/enabler/notify.rb, line 29
def main_event
  events.last || create_success
end
notify(event, *args) click to toggle source
# File lib/controll/enabler/notify.rb, line 19
def notify event, *args
  events << normalize(event, *args)
  self # enable method chaining on controller
end

Protected Instance Methods

process_events(notifier = nil) click to toggle source
# File lib/controll/enabler/notify.rb, line 35
def process_events notifier = nil
  notifier ||= self.notifier
  events.each do |event|
    notifier.send(event.type).notify event.name, event.options
  end
end