Created
December 1, 2011 16:25
-
-
Save benlangfeld/1417950 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
class Foo | |
end | |
class Bar < Foo | |
end | |
new_controller = catch :controller_jump do | |
throw :controller_jump, Bar | |
end | |
return new_controller.new(call).run | |
route :to => MyController | |
MyController.new(call).run | |
class MyController < Adhearsion::CallController | |
def run | |
answer | |
menu do | |
match 1, BooController | |
match /2/, MyOtherController | |
match /3/, YetAnotherController | |
match /4|5/, FooController | |
match(6..10) { dar } | |
timeout { timeout } | |
invalid do | |
speak "Sorry, that's wrong!" | |
end | |
end | |
end | |
def dar | |
speak 'dar' | |
end | |
def timeout | |
speak 'Timeout' | |
end | |
end | |
menu do | |
link.foo_bar 1 | |
end | |
FooBar.new(call).run | |
class MyOtherController < Adhearsion::CallController | |
def run | |
speak 'foobar' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment