Module: AdhearsionCpa::ControllerMethods
- Defined in:
- lib/adhearsion_cpa/controller_methods.rb
Instance Method Summary collapse
-
#detect_tone(*arguments) ⇒ PunchBlock::Signal?
Detects a tone.
-
#detect_tone!(*arguments) ⇒ Object
Begin asynchronous tone detection, and run the block when the tone is detected.
Instance Method Details
#detect_tone(*arguments) ⇒ PunchBlock::Signal?
Detects a tone
18 19 20 21 |
# File 'lib/adhearsion_cpa/controller_methods.rb', line 18 def detect_tone(*arguments) = arguments.last.is_a?(Hash) && arguments.count > 1 ? arguments.pop : {} ToneDetector.new(self).detect_tones arguments, end |
#detect_tone!(*arguments) ⇒ Object
Begin asynchronous tone detection, and run the block when the tone is detected
28 29 30 31 |
# File 'lib/adhearsion_cpa/controller_methods.rb', line 28 def detect_tone!(*arguments) = arguments.last.is_a?(Hash) && arguments.count > 1 ? arguments.pop : {} ToneDetector.new(self).detect_tones arguments, .merge(async: true), &Proc.new end |