Module: Chase::Events
Overview
Basic events emitter
Instance Method Summary collapse
Instance Method Details
#emit(event, *args) ⇒ Object
8 9 10 |
# File 'lib/chase/events.rb', line 8 def emit(event, *args) __events[event].each { |cb| cb.call(*args) } end |
#on(event, &block) ⇒ Object
4 5 6 |
# File 'lib/chase/events.rb', line 4 def on(event, &block) __events[event] << block end |