Created
October 10, 2012 01:36
-
-
Save azendal/3862629 to your computer and use it in GitHub Desktop.
CustomEventSupport
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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