Class: Punchblock::Component::Record
- Inherits:
-
ComponentNode
- Object
- Niceogiri::XML::Node
- RayoNode
- Punchblock::CommandNode
- ComponentNode
- Punchblock::Component::Record
- Defined in:
- lib/punchblock/component/record.rb
Defined Under Namespace
Classes: Complete, Pause, Recording, Resume
Instance Attribute Summary
Attributes inherited from RayoNode
#client, #component_id, #connection, #domain, #original_component, #target_call_id, #target_mixer_name
Class Method Summary (collapse)
-
+ (Command::Record) new(options = {})
Creates an Rayo Record command.
Instance Method Summary (collapse)
-
- (String) final_timeout
The codec to use for recording.
- - (Object) final_timeout=(timeout)
-
- (String) format
The codec to use for recording.
- - (Object) format=(format)
-
- (String) initial_timeout
The codec to use for recording.
- - (Object) initial_timeout=(timeout)
-
- (Object) inspect_attributes
:nodoc:.
-
- (String) max_duration
The codec to use for recording.
- - (Object) max_duration=(other)
-
- (Object) pause!
Sends an Rayo pause message for the current Record.
-
- (Command::Record::Pause) pause_action
Pauses a running Record.
-
- (Object) resume!
Sends an Rayo resume message for the current Record.
-
- (Command::Record::Resume) resume_action
Create an Rayo resume message for the current Record.
-
- (String) start_beep
The codec to use for recording.
- - (Object) start_beep=(sb)
-
- (String) start_paused
The codec to use for recording.
- - (Object) start_paused=(other)
-
- (String) stop_beep
The codec to use for recording.
- - (Object) stop_beep=(sb)
Methods inherited from ComponentNode
#add_event, #complete_event, #complete_event=, #initialize, #register_event_handler, #register_internal_handlers, #response=, #stop!, #stop_action, #trigger_event_handler, #write_action
Methods inherited from Punchblock::CommandNode
#initialize, #response, #response=, #write_attr
Methods inherited from RayoNode
class_from_registration, #eql?, import, #inspect, register, #source
Constructor Details
This class inherits a constructor from Punchblock::Component::ComponentNode
Class Method Details
+ (Command::Record) new(options = {})
Creates an Rayo Record command
24 25 26 27 28 |
# File 'lib/punchblock/component/record.rb', line 24 def self.new( = {}) super().tap do |new_node| .each_pair { |k,v| new_node.send :#{k}=", v } end end |
Instance Method Details
- (String) final_timeout
The codec to use for recording
33 34 35 |
# File 'lib/punchblock/component/record.rb', line 33 def final_timeout read_attr :final-timeout', :to_i end |
- (Object) final_timeout=(timeout)
40 41 42 |
# File 'lib/punchblock/component/record.rb', line 40 def final_timeout=(timeout) write_attr :final-timeout', timeout end |
- (String) format
The codec to use for recording
47 48 49 |
# File 'lib/punchblock/component/record.rb', line 47 def format read_attr :format end |
- (Object) format=(format)
54 55 56 |
# File 'lib/punchblock/component/record.rb', line 54 def format=(format) write_attr :format, format end |
- (String) initial_timeout
The codec to use for recording
61 62 63 |
# File 'lib/punchblock/component/record.rb', line 61 def initial_timeout read_attr :initial-timeout', :to_i end |
- (Object) initial_timeout=(timeout)
68 69 70 |
# File 'lib/punchblock/component/record.rb', line 68 def initial_timeout=(timeout) write_attr :initial-timeout', timeout end |
- (Object) inspect_attributes
:nodoc:
128 129 130 |
# File 'lib/punchblock/component/record.rb', line 128 def inspect_attributes # :nodoc: [:final_timeout, :format, :initial_timeout, :max_duration, :start_beep, :start_paused, :stop_beep] + super end |
- (String) max_duration
The codec to use for recording
75 76 77 |
# File 'lib/punchblock/component/record.rb', line 75 def max_duration read_attr :max-duration', :to_i end |
- (Object) max_duration=(other)
82 83 84 |
# File 'lib/punchblock/component/record.rb', line 82 def max_duration=(other) write_attr :max-duration', other end |
- (Object) pause!
Sends an Rayo pause message for the current Record
158 159 160 161 162 163 164 |
# File 'lib/punchblock/component/record.rb', line 158 def pause! raise InvalidActionError, "Cannot pause a Record that is not executing" unless executing? pause_action.tap do |action| result = write_action action paused! if result end end |
- (Command::Record::Pause) pause_action
Pauses a running Record
151 152 153 |
# File 'lib/punchblock/component/record.rb', line 151 def pause_action Pause.new :component_id => component_id, :target_call_id => target_call_id end |
- (Object) resume!
Sends an Rayo resume message for the current Record
183 184 185 186 187 188 189 |
# File 'lib/punchblock/component/record.rb', line 183 def resume! raise InvalidActionError, "Cannot resume a Record that is not paused." unless paused? resume_action.tap do |action| result = write_action action resumed! if result end end |
- (Command::Record::Resume) resume_action
Create an Rayo resume message for the current Record
176 177 178 |
# File 'lib/punchblock/component/record.rb', line 176 def resume_action Resume.new :component_id => component_id, :target_call_id => target_call_id end |
- (String) start_beep
The codec to use for recording
89 90 91 |
# File 'lib/punchblock/component/record.rb', line 89 def start_beep read_attr(:start-beep') == 'true' end |
- (Object) start_beep=(sb)
96 97 98 |
# File 'lib/punchblock/component/record.rb', line 96 def start_beep=(sb) write_attr :start-beep', sb end |
- (String) start_paused
The codec to use for recording
117 118 119 |
# File 'lib/punchblock/component/record.rb', line 117 def start_paused read_attr(:start-paused') == 'true' end |
- (Object) start_paused=(other)
124 125 126 |
# File 'lib/punchblock/component/record.rb', line 124 def start_paused=(other) write_attr :start-paused', other end |
- (String) stop_beep
The codec to use for recording
103 104 105 |
# File 'lib/punchblock/component/record.rb', line 103 def stop_beep read_attr(:stop-beep') == 'true' end |
- (Object) stop_beep=(sb)
110 111 112 |
# File 'lib/punchblock/component/record.rb', line 110 def stop_beep=(sb) write_attr :stop-beep', sb end |