Skip to content

Instantly share code, notes, and snippets.

@azendal
Created October 10, 2012 01:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azendal/3862629 to your computer and use it in GitHub Desktop.
Save azendal/3862629 to your computer and use it in GitHub Desktop.
CustomEventSupport
# Example CustomEvent
class Dispatcher
include CustomEventSupport
include BubblingSupport
def set_property(value)
dispatch 'property_change', {:value => value}
end
end
a = Dispatcher.new
a.bind 'property_change' do |event|
puts event.value
end
a.set_property 'hey there'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment