Created
October 28, 2010 19:47
-
-
Save chrismetcalf/652184 to your computer and use it in GitHub Desktop.
King County Tree Disposal Line - Greeting
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
answer | |
sleep(2) | |
say "Welcome to the King County Christmas Tree Recycling Line." | |
# Setting up our options for "ask". We accept 5 digits, either spoken or entered | |
# by DTMF, and time out after 10 seconds. | |
zipcode_options = { :choices => "[5 DIGITS]", | |
:repeat => 3, | |
:timeout => 10, | |
:onBadChoice => lambda { say 'Invalid entry, please try again.' }, | |
:onTimeout => lambda { say 'Timeout, please try again.' }, | |
:onChoice => lambda { |zip| lookup_facilities(zip.value) } | |
} | |
ask 'Enter or say your ZIP code to find a Christmas tree facility in your area.', zipcode_options |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment