Sha256: 693bbc25775e82c73df8c1f2c12d554620305da6bb2f679c4191ec634e40a4d4

Contents?: true

Size: 1.3 KB

Versions: 7

Compression:

Stored size: 1.3 KB

Contents

require_relative 'xml_verb'

module Bandwidth 
  module Voice 
    # The Gather verb is used to collect digits for some period of time
    class Gather
      include XmlVerb

      def to_bxml(xml)
        xml.Gather(compact_hash({
          'gatherUrl' => gather_url,
          'gatherMethod' => gather_method,
          'terminatingDigits' => terminating_digits,
          'tag' => tag,
          'maxDigits' => max_digits,
          'interDigitTimeout' => inter_digit_timeout,
          'username' => username,
          'password' => password,
          'firstDigitTimeout' => first_digit_timeout,
          'repeatCount' => repeat_count
         })) do
           def embedded_xml(xml, property, type)
             if property
               s = if property.is_a?(type)
                     then property
                   else type.new(property)
                     end
               s.to_bxml(xml)
             end
           end
           def nest_verbs_list(xml, property)
             if property
               property.each do |verb|
                 verb.to_bxml(xml)
               end
             end
           end
          embedded_xml(xml, speak_sentence, SpeakSentence)
          embedded_xml(xml, play_audio, PlayAudio)
          nest_verbs_list(xml, nested_verbs)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bandwidth-sdk-3.9.0 lib/bandwidth/voice_lib/bxml/verbs/gather.rb
bandwidth-sdk-3.8.0 lib/bandwidth/voice_lib/bxml/verbs/gather.rb
bandwidth-sdk-3.7.0 lib/bandwidth/voice_lib/bxml/verbs/gather.rb
bandwidth-sdk-3.6.0 lib/bandwidth/voice_lib/bxml/verbs/gather.rb
bandwidth-sdk-3.5.0 lib/bandwidth/voice_lib/bxml/verbs/gather.rb
bandwidth-sdk-3.4.0 lib/bandwidth/voice_lib/bxml/verbs/gather.rb
bandwidth-sdk-3.3.0 lib/bandwidth/voice_lib/bxml/verbs/gather.rb