Class: Adhearsion::CallController::Record::Recorder
- Defined in:
- lib/adhearsion/call_controller/record.rb
Overview
Handle a recording
Instance Attribute Summary collapse
-
#record_component ⇒ Object
Returns the value of attribute record_component.
-
#stopper_component ⇒ Object
Returns the value of attribute stopper_component.
Instance Method Summary collapse
-
#handle_record_completion {|Adhearsion::Event::Complete| ... } ⇒ Object
Set a callback to be executed when recording completes.
-
#initialize(controller, options = {}) ⇒ Recorder
constructor
A new instance of Recorder.
-
#run ⇒ Object
Execute the recorder.
Constructor Details
#initialize(controller, options = {}) ⇒ Recorder
Returns a new instance of Recorder.
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/adhearsion/call_controller/record.rb', line 29 def initialize(controller, = {}) @controller = controller = @async = .delete :async interruptible = .delete :interruptible @stopper_component = interruptible ? setup_stopper(interruptible) : nil @record_component = Adhearsion::Rayo::Component::Record.new end |
Instance Attribute Details
#record_component ⇒ Object
Returns the value of attribute record_component.
14 15 16 |
# File 'lib/adhearsion/call_controller/record.rb', line 14 def record_component @record_component end |
#stopper_component ⇒ Object
Returns the value of attribute stopper_component.
14 15 16 |
# File 'lib/adhearsion/call_controller/record.rb', line 14 def stopper_component @stopper_component end |
Instance Method Details
#handle_record_completion {|Adhearsion::Event::Complete| ... } ⇒ Object
Set a callback to be executed when recording completes
58 59 60 |
# File 'lib/adhearsion/call_controller/record.rb', line 58 def handle_record_completion(&block) @record_component.register_event_handler Adhearsion::Event::Complete, &block end |
#run ⇒ Object
Execute the recorder
46 47 48 49 50 51 |
# File 'lib/adhearsion/call_controller/record.rb', line 46 def run execute_stopper execute_recording terminate_stopper nil end |