Sha256: ae43bd24a7d628a4ef36be99ad3f1d3762dceee68a358d7ead35e20b4b0e73e6

Contents?: true

Size: 1.07 KB

Versions: 5

Compression:

Stored size: 1.07 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
          embedded_xml(xml, speak_sentence, SpeakSentence)
          embedded_xml(xml, play_audio, PlayAudio)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bandwidth-sdk-2.0.0 lib/bandwidth/voice_lib/bxml/verbs/gather.rb
bandwidth-sdk-1.0.2 lib/bandwidth/voice_lib/bxml/verbs/gather.rb
bandwidth-sdk-1.0.1 lib/bandwidth/voice_lib/bxml/verbs/gather.rb
bandwidth-sdk-1.0.0 lib/bandwidth/voice_lib/bxml/verbs/gather.rb
bandwidth-sdk-1.0.0.pre lib/bandwidth/voice_lib/bxml/verbs/gather.rb