Created
December 1, 2011 16:23
-
-
Save benlangfeld/1417944 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
methods_for :dialplan do | |
def baz | |
speak 'Baz' | |
end | |
end | |
foo { | |
menu do |link| | |
link.bar 1 | |
link.baz 2 | |
end | |
} | |
bar { | |
speak 'Bar' | |
} | |
class Menu | |
def match(&block) | |
controller = eval 'self', block.binding | |
controller.instance_eval &block | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment