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

Instance Method Details

#executeObject



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.message
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

#noinputObject



37
38
39
# File 'lib/punchblock/translator/input_component.rb', line 37

def noinput
  complete Punchblock::Component::Input::Complete::NoInput.new
end

#nomatchObject



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