Module: Reactor::Subscribable::ClassMethods

Defined in:
lib/reactor/models/concerns/subscribable.rb

Instance Method Summary collapse

Instance Method Details

#on_event(*args, &block) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/reactor/models/concerns/subscribable.rb', line 7

def on_event(*args, &block)
  options = args.extract_options!
  options[:event_name], options[:action] = args
  options[:action] ||= block
  options[:source] = self
  add_subscription(options)
end