Skip to content

Instantly share code, notes, and snippets.

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