Module: LifecycleCallbacks

Included in:
DslRuntime
Defined in:
lib/roundtrip_xml/lifecycle_callbacks.rb

Instance Method Summary collapse

Instance Method Details

#initializeObject



3
4
5
# File 'lib/roundtrip_xml/lifecycle_callbacks.rb', line 3

def initialize
  @callbacks = {}
end

#on(event, &callback) ⇒ Object



6
7
8
9
# File 'lib/roundtrip_xml/lifecycle_callbacks.rb', line 6

def on (event, &callback)
  callbacks[event] ||= []
  callbacks[event] << callback
end