Created
October 1, 2008 23:19
-
-
Save bakkdoor/14228 to your computer and use it in GitHub Desktop.
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
def create_listener(superclass, methodname, &block) | |
focus_listener_class = Class.new() do | |
include superclass | |
implement superclass | |
def initialize(methodname, &block) | |
@block = block | |
define_method(methodname) do | |
@block.call | |
end | |
#create_method(methodname, &block) | |
end | |
end | |
focus_listener_class.new(methodname, &block) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment