Class: Twilio::TwiML::Connect

Inherits:
TwiML
  • Object
show all
Defined in:
lib/twilio-ruby/twiml/voice_response.rb

Overview

<Connect> TwiML Verb

Instance Attribute Summary

Attributes inherited from TwiML

#name

Instance Method Summary collapse

Methods inherited from TwiML

#add_child, #add_text, #append, #comment, to_lower_camel_case, #to_s, #xml

Constructor Details

#initialize(**keyword_args) {|_self| ... } ⇒ Connect

Returns a new instance of Connect.

Yields:

  • (_self)

Yield Parameters:



1066
1067
1068
1069
1070
1071
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1066

def initialize(**keyword_args)
  super(**keyword_args)
  @name = 'Connect'

  yield(self) if block_given?
end

Instance Method Details

#autopilot(name, **keyword_args) ⇒ Object

Create a new <Autopilot> element

name

Autopilot assistant sid or unique name

keyword_args

additional attributes



1086
1087
1088
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1086

def autopilot(name, **keyword_args)
  append(Autopilot.new(name, **keyword_args))
end

#room(name, participant_identity: nil, **keyword_args) ⇒ Object

Create a new <Room> element

name

Room name

participant_identity

Participant identity when connecting to the Room

keyword_args

additional attributes



1078
1079
1080
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1078

def room(name, participant_identity: nil, **keyword_args)
  append(Room.new(name, participant_identity: participant_identity, **keyword_args))
end

#stream(name: nil, connector_name: nil, url: nil, track: nil, **keyword_args) {|stream| ... } ⇒ Object

Create a new <Stream> element

name

Friendly name given to the Stream

connector_name

Unique name for Stream Connector

url

URL of the remote service where the Stream is routed

track

Track to be streamed to remote service

keyword_args

additional attributes

Yields:



1097
1098
1099
1100
1101
1102
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1097

def stream(name: nil, connector_name: nil, url: nil, track: nil, **keyword_args)
  stream = Stream.new(name: name, connector_name: connector_name, url: url, track: track, **keyword_args)

  yield(stream) if block_given?
  append(stream)
end