Class: Bandwidth::Bxml::SpeakSentence
- Defined in:
- lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb
Instance Method Summary collapse
-
#initialize(text, attributes = {}) ⇒ SpeakSentence
constructor
Initializer.
-
#to_bxml ⇒ String
Return BXML representaion of this response.
Methods inherited from Verb
#generate_xml, #set_attributes
Constructor Details
#initialize(text, attributes = {}) ⇒ SpeakSentence
Initializer
7 8 9 10 11 12 13 14 15 |
# File 'lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb', line 7 def initialize(text, attributes = {}) super('SpeakSentence', text, attributes) @attribute_map = { voice: 'voice', # Optional [String]: Selects the voice of the speaker. If the voice attribute is present, gender and locale are ignored. You can find a list of supported voices here: https://dev.bandwidth.com/docs/voice/bxml/speakSentence/#supported-voices gender: 'gender', # Optional [String]: Selects the gender of the speaker. Valid values are "male" or "female". Default "female". locale: 'locale', # Optional [String]: Selects the locale of the speaker. Default "en_US" } end |
Instance Method Details
#to_bxml ⇒ String
Return BXML representaion of this response
19 20 21 22 |
# File 'lib/bandwidth-sdk/models/bxml/verbs/speak_sentence.rb', line 19 def to_bxml bxml = Ox.dump(generate_xml) bxml.gsub(SPEAK_SENTENCE_REGEX) { |text| text.gsub(SSML_REGEX, '<\1>') } end |