Skip to content

Instantly share code, notes, and snippets.

@benlangfeld
Created December 1, 2011 16:23
Show Gist options
  • Save benlangfeld/1417944 to your computer and use it in GitHub Desktop.
Save benlangfeld/1417944 to your computer and use it in GitHub Desktop.
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