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 {|Punchblock::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.
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/adhearsion/call_controller/record.rb', line 27 def initialize(controller, = {}) @controller = controller = @async = .delete :async interruptible = .delete :interruptible @stopper_component = interruptible ? setup_stopper(interruptible) : nil @record_component = Punchblock::Component::Record.new end |
Instance Attribute Details
#record_component ⇒ Object
Returns the value of attribute record_component.
12 13 14 |
# File 'lib/adhearsion/call_controller/record.rb', line 12 def record_component @record_component end |
#stopper_component ⇒ Object
Returns the value of attribute stopper_component.
12 13 14 |
# File 'lib/adhearsion/call_controller/record.rb', line 12 def stopper_component @stopper_component end |
Instance Method Details
#handle_record_completion {|Punchblock::Event::Complete| ... } ⇒ Object
Set a callback to be executed when recording completes
56 57 58 |
# File 'lib/adhearsion/call_controller/record.rb', line 56 def handle_record_completion(&block) @record_component.register_event_handler Punchblock::Event::Complete, &block end |
#run ⇒ Object
Execute the recorder
44 45 46 47 48 49 |
# File 'lib/adhearsion/call_controller/record.rb', line 44 def run execute_stopper execute_recording terminate_stopper nil end |