Class: Punchblock::Command::Join
- Inherits:
-
Punchblock::CommandNode
- Object
- Niceogiri::XML::Node
- RayoNode
- Punchblock::CommandNode
- Punchblock::Command::Join
- Defined in:
- lib/punchblock/command/join.rb
Constant Summary collapse
- VALID_DIRECTIONS =
[:duplex, :send, :recv].freeze
Constants inherited from RayoNode
Instance Attribute Summary
Attributes inherited from RayoNode
#client, #component_id, #connection, #domain, #original_component, #target_call_id, #target_mixer_name
Class Method Summary collapse
-
.new(options = {}) ⇒ Command::Join
Create a join command.
Instance Method Summary collapse
-
#call_id ⇒ String
The call ID to join.
- #call_id=(other) ⇒ Object
-
#direction ⇒ String
The direction in which media should flow.
- #direction=(direction) ⇒ Object
-
#inspect_attributes ⇒ Object
:nodoc:.
-
#media ⇒ String
The method by which to negotiate media.
- #media=(other) ⇒ Object
-
#mixer_name ⇒ String
The mixer name to join.
- #mixer_name=(other) ⇒ Object
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::CommandNode
Class Method Details
.new(options = {}) ⇒ Command::Join
Create a join command
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/punchblock/command/join.rb', line 21 def self.new( = {}) super().tap do |new_node| case when Nokogiri::XML::Node new_node.inherit when Hash .each_pair { |k,v| new_node.send :"#{k}=", v } end end end |
Instance Method Details
#call_id ⇒ String
Returns the call ID to join.
34 35 36 |
# File 'lib/punchblock/command/join.rb', line 34 def call_id read_attr :'call-id' end |
#call_id=(other) ⇒ Object
40 41 42 |
# File 'lib/punchblock/command/join.rb', line 40 def call_id=(other) write_attr :'call-id', other end |
#direction ⇒ String
Returns the direction in which media should flow.
58 59 60 |
# File 'lib/punchblock/command/join.rb', line 58 def direction read_attr :direction, :to_sym end |
#direction=(direction) ⇒ Object
64 65 66 67 68 69 |
# File 'lib/punchblock/command/join.rb', line 64 def direction=(direction) if direction && !VALID_DIRECTIONS.include?(direction.to_sym) raise ArgumentError, "Invalid Direction (#{direction}), use: #{VALID_DIRECTIONS*' '}" end write_attr :direction, direction end |
#inspect_attributes ⇒ Object
:nodoc:
83 84 85 |
# File 'lib/punchblock/command/join.rb', line 83 def inspect_attributes # :nodoc: [:call_id, :mixer_name, :direction, :media] + super end |
#media ⇒ String
Returns the method by which to negotiate media.
73 74 75 |
# File 'lib/punchblock/command/join.rb', line 73 def media read_attr :media, :to_sym end |
#media=(other) ⇒ Object
79 80 81 |
# File 'lib/punchblock/command/join.rb', line 79 def media=(other) write_attr :media, other end |
#mixer_name ⇒ String
Returns the mixer name to join.
46 47 48 |
# File 'lib/punchblock/command/join.rb', line 46 def mixer_name read_attr :'mixer-name' end |
#mixer_name=(other) ⇒ Object
52 53 54 |
# File 'lib/punchblock/command/join.rb', line 52 def mixer_name=(other) write_attr :'mixer-name', other end |