Method: Syndi::DSL::Base#on

Defined in:
lib/syndi/dsl/base.rb

#on(sys, event, &prc) ⇒ Object

Hook onto an event.

Parameters:

  • system (Symbol)

    The events system to access.

  • event (Symbol)

    The event onto which to hook.

See Also:

  • API::Events#on

Since:

  • 4.0.0



32
33
34
35
36
37
38
# File 'lib/syndi/dsl/base.rb', line 32

def on(sys, event, &prc)
  if sys == :syndi # central system
    $m.events.on(event, prc)
  else
    $m.send(sys).events.on(event, prc) if $m.respond_to? sys
  end
end