Class: Twilio::TwiML::Prompt
- Defined in:
- lib/twilio-ruby/twiml/voice_response.rb
Overview
<Prompt> Twiml Verb
Instance Attribute Summary
Attributes inherited from TwiML
Instance Method Summary collapse
-
#initialize(**keyword_args) {|_self| ... } ⇒ Prompt
constructor
A new instance of Prompt.
-
#pause(length: nil, **keyword_args) ⇒ Object
- Create a new <Pause> element length
- Length in seconds to pause keyword_args
-
additional attributes.
-
#play(url: nil, loop: nil, digits: nil, **keyword_args) ⇒ Object
- Create a new <Play> element url
- Media URL loop
- Times to loop media digits
- Play DTMF tones for digits keyword_args
-
additional attributes.
-
#say(message: nil, voice: nil, loop: nil, language: nil, **keyword_args) {|say| ... } ⇒ Object
- Create a new <Say> element message
- Message to say voice
- Voice to use loop
- Times to loop message language
- Message langauge keyword_args
-
additional attributes.
Methods inherited from TwiML
#add_child, #add_text, #append, #comment, to_lower_camel_case, #to_s, #xml
Constructor Details
#initialize(**keyword_args) {|_self| ... } ⇒ Prompt
Returns a new instance of Prompt.
406 407 408 409 410 411 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 406 def initialize(**keyword_args) super(**keyword_args) @name = 'Prompt' yield(self) if block_given? end |
Instance Method Details
#pause(length: nil, **keyword_args) ⇒ Object
Create a new <Pause> element
- length
-
Length in seconds to pause
- keyword_args
-
additional attributes
441 442 443 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 441 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 <Play> element
- url
-
Media URL
- loop
-
Times to loop media
- digits
-
Play DTMF tones for digits
- keyword_args
-
additional attributes
433 434 435 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 433 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 <Say> element
- message
-
Message to say
- voice
-
Voice to use
- loop
-
Times to loop message
- language
-
Message langauge
- keyword_args
-
additional attributes
420 421 422 423 424 425 |
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 420 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 |