Class: Twilio::TwiML::Gather

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

Overview

<Gather> element

Instance Attribute Summary

Attributes inherited from TwiML

#indent, #name

Instance Method Summary collapse

Methods inherited from TwiML

#append, to_lower_camel_case, #to_s, #xml

Constructor Details

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

Create a <Gather> element

Parameters:

keyword_args

additional attributes

Returns:

A <Gather> element

Yields:

  • (_self)

Yield Parameters:



724
725
726
727
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 724

def initialize(**keyword_args)
  super(**keyword_args)
  yield(self) if block_given?
end

Instance Method Details

#pause(length: nil) ⇒ Object

Create a <Pause> element

Parameters:

length

time to pause

Returns:

A <Gather> element with a <Pause> child element



777
778
779
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 777

def pause(length: nil)
  append(Pause.new(length: length))
end

#play(url: nil, loop: nil, digits: nil, **keyword_args) ⇒ Object

Create a <Play> element

Parameters:

url

media URL

loop

times to loop

digits

digits to simulate

keyword_args

additional attributes

Returns:

A <Gather> element with a <Play> child element



761
762
763
764
765
766
767
768
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 761

def play(url: nil, loop: nil, digits: nil, **keyword_args)
  append(Play.new(
           url: url,
           loop: loop,
           digits: digits,
           **keyword_args
  ))
end

#say(body, loop: nil, language: nil, voice: nil, **keyword_args) ⇒ Object

Create a <Say> element

Parameters:

name

name of client

body

message body

loop

times to loop

language

message language

voice

voice to use

keyword_args

additional attributes

Returns:

A <Gather> element with a <Say> child element



741
742
743
744
745
746
747
748
749
# File 'lib/twilio-ruby/twiml/voice_response.rb', line 741

def say(body, loop: nil, language: nil, voice: nil, **keyword_args)
  append(Say.new(
           body,
           loop: loop,
           language: language,
           voice: voice,
           **keyword_args
  ))
end