Module: Punchblock::Translator::InputComponent
- Included in:
- Asterisk::Component::ComposedPrompt, Asterisk::Component::Input, Freeswitch::Component::Input
- Defined in:
- lib/punchblock/translator/input_component.rb
Instance Method Summary collapse
- #execute ⇒ Object
- #execute_command(command) ⇒ Object
- #match(match) ⇒ Object
- #noinput ⇒ Object
- #nomatch ⇒ Object
- #process_dtmf(digit) ⇒ Object
Instance Method Details
#execute ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/punchblock/translator/input_component.rb', line 6 def execute validate setup_dtmf_recognizer send_ref start_timers rescue OptionError, ArgumentError => e with_error 'option error', e. end |
#execute_command(command) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/punchblock/translator/input_component.rb', line 19 def execute_command(command) case command when Punchblock::Component::Stop command.response = true complete Punchblock::Event::Complete::Stop.new else super end end |
#match(match) ⇒ Object
29 30 31 |
# File 'lib/punchblock/translator/input_component.rb', line 29 def match(match) complete success_reason(match) end |
#noinput ⇒ Object
37 38 39 |
# File 'lib/punchblock/translator/input_component.rb', line 37 def noinput complete Punchblock::Component::Input::Complete::NoInput.new end |
#nomatch ⇒ Object
33 34 35 |
# File 'lib/punchblock/translator/input_component.rb', line 33 def nomatch complete Punchblock::Component::Input::Complete::NoMatch.new end |
#process_dtmf(digit) ⇒ Object
15 16 17 |
# File 'lib/punchblock/translator/input_component.rb', line 15 def process_dtmf(digit) @recognizer << digit end |