Class: Punchblock::Command::Join

Inherits:
Punchblock::CommandNode show all
Defined in:
lib/punchblock/command/join.rb

Constant Summary

Constants inherited from RayoNode

RayoNode::InvalidNodeError

Instance Attribute Summary

Attributes inherited from RayoNode

#client, #component_id, #connection, #domain, #original_component, #target_call_id, #target_mixer_name

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :call_id (String, Optional)

    the call ID to join

  • :mixer_name (String, Optional)

    the mixer name to join

  • :direction (Symbol, Optional)

    the direction in which media should flow

  • :media (Symbol, Optional)

    the method by which to negotiate media

Returns:



19
20
21
22
23
24
25
26
27
28
# File 'lib/punchblock/command/join.rb', line 19

def self.new(options = {})
  super().tap do |new_node|
    case options
    when Nokogiri::XML::Node
      new_node.inherit options
    when Hash
      options.each_pair { |k,v| new_node.send :"#{k}=", v }
    end
  end
end

Instance Method Details

#call_idString

Returns the call ID to join.

Returns:

  • (String)

    the call ID to join



32
33
34
# File 'lib/punchblock/command/join.rb', line 32

def call_id
  read_attr :'call-id'
end

#call_id=(other) ⇒ Object

Parameters:

  • other (String)

    the call ID to join



38
39
40
# File 'lib/punchblock/command/join.rb', line 38

def call_id=(other)
  write_attr :'call-id', other
end

#directionString

Returns the direction in which media should flow.

Returns:

  • (String)

    the direction in which media should flow



56
57
58
# File 'lib/punchblock/command/join.rb', line 56

def direction
  read_attr :direction, :to_sym
end

#direction=(other) ⇒ Object

Parameters:

  • other (String)

    the direction in which media should flow. Can be :duplex, :recv or :send



62
63
64
# File 'lib/punchblock/command/join.rb', line 62

def direction=(other)
  write_attr :direction, other
end

#inspect_attributesObject

:nodoc:



78
79
80
# File 'lib/punchblock/command/join.rb', line 78

def inspect_attributes # :nodoc:
  [:call_id, :mixer_name, :direction, :media] + super
end

#mediaString

Returns the method by which to negotiate media.

Returns:

  • (String)

    the method by which to negotiate media



68
69
70
# File 'lib/punchblock/command/join.rb', line 68

def media
  read_attr :media, :to_sym
end

#media=(other) ⇒ Object

Parameters:

  • other (String)

    the method by which to negotiate media. Can be :direct or :bridge



74
75
76
# File 'lib/punchblock/command/join.rb', line 74

def media=(other)
  write_attr :media, other
end

#mixer_nameString

Returns the mixer name to join.

Returns:

  • (String)

    the mixer name to join



44
45
46
# File 'lib/punchblock/command/join.rb', line 44

def mixer_name
  read_attr :'mixer-name'
end

#mixer_name=(other) ⇒ Object

Parameters:

  • other (String)

    the mixer name to join



50
51
52
# File 'lib/punchblock/command/join.rb', line 50

def mixer_name=(other)
  write_attr :'mixer-name', other
end