Guest User

Untitled

a guest
Jun 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. answer
  2. sleep(2)
  3. say "Welcome to the King County Christmas Tree Recycling Line."
  4.  
  5. # Setting up our options for "ask". We accept 5 digits, either spoken or entered
  6. # by DTMF, and time out after 10 seconds.
  7. zipcode_options = { :choices => "[5 DIGITS]",
  8. :repeat => 3,
  9. :timeout => 10,
  10. :onBadChoice => lambda { say 'Invalid entry, please try again.' },
  11. :onTimeout => lambda { say 'Timeout, please try again.' },
  12. :onChoice => lambda { |zip| lookup_facilities(zip.value) }
  13. }
  14.  
  15. ask 'Enter or say your ZIP code to find a Christmas tree facility in your area.', zipcode_options
Add Comment
Please, Sign In to add comment