Module: Chase::Events

Included in:
Request, Response
Defined in:
lib/chase/events.rb

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