Class: Twilio::TwiML::Gather
- Defined in:
- lib/twilio-ruby/twiml/voice_response.rb
Overview
Instance Attribute Summary
Attributes inherited from TwiML
Instance Method Summary collapse
-
#initialize(**keyword_args) {|_self| ... } ⇒ Gather
constructor
A new instance of Gather.
-
#pause(length: nil, **keyword_args) ⇒ Object
- Create a new
element length - Length in seconds to pause keyword_args
additional attributes.
- Create a new
-
#play(url: nil, loop: nil, digits: nil, **keyword_args) ⇒ Object
- Create a new
element url - Media URL loop
- Times to loop media digits
- Play DTMF tones for digits keyword_args
additional attributes.
- Create a new
-
#say(message: nil, voice: nil, loop: nil, language: nil, **keyword_args) {|say| ... } ⇒ Object
- Create a new
element message - Message to say voice
- Voice to use loop
- Times to loop message language
- Message language keyword_args
additional attributes.
- Create a new
Methods inherited from TwiML
#add_child, #add_text, #append, #comment, to_lower_camel_case, #to_s, #xml
Constructor Details
#initialize(**keyword_args) {|_self| ... } ⇒ Gather
Returns a new instance of Gather.
1573 1574 1575 1576 1577 1578 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1573 def initialize(**keyword_args) super(**keyword_args) @name = 'Gather' yield(self) if block_given? end |
Instance Method Details
#pause(length: nil, **keyword_args) ⇒ Object
Create a new
- length
Length in seconds to pause
- keyword_args
additional attributes
1598 1599 1600 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1598 def pause(length: nil, **keyword_args) append(Pause.new(length: length, **keyword_args)) end |
#play(url: nil, loop: nil, digits: nil, **keyword_args) ⇒ Object
Create a new
- url
Media URL
- loop
Times to loop media
- digits
Play DTMF tones for digits
- keyword_args
additional attributes
1608 1609 1610 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1608 def play(url: nil, loop: nil, digits: nil, **keyword_args) append(Play.new(url: url, loop: loop, digits: digits, **keyword_args)) end |
#say(message: nil, voice: nil, loop: nil, language: nil, **keyword_args) {|say| ... } ⇒ Object
Create a new
- message
Message to say
- voice
Voice to use
- loop
Times to loop message
- language
Message language
- keyword_args
additional attributes
1587 1588 1589 1590 1591 1592 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 1587 def say(message: nil, voice: nil, loop: nil, language: nil, **keyword_args) say = Say.new(message: , voice: voice, loop: loop, language: language, **keyword_args) yield(say) if block_given? append(say) end |