Sha256: 17f441821890b24f0adf4187ac847da3bcc06f83e9eecb6a5bfb82a1ed58b4d8

Contents?: true

Size: 797 Bytes

Versions: 1

Compression:

Stored size: 797 Bytes

Contents

require 'builder'
Dir[File.dirname(__FILE__) + '/verbs/*'].each {|file|
  require_relative file
}

module Bandwidth
	module Voice
	  class Response
	    # Initializer
	    # @param verbs [Array] optional list of verbs to include into response
	    def initialize(verbs = nil)
	      @verbs = verbs || []
	    end

	    # Return XML presentaion of this response
	    def to_xml()
	      xml = Builder::XmlMarkup.new()
	      xml.instruct!(:xml, :version=>'1.0', :encoding=>'UTF-8')
	      xml.Response do
	        @verbs.each {|verb| verb.to_xml(xml)}
	      end
	      xml.target!()
	    end

	    # Add one or more verbs to this response
	    def push(*verbs)
	      @verbs.push(*verbs)
	    end

	    # Add a verb to this response
	    def <<(verb)
	      @verbs << verb
	    end
	  end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bandwidth-sdk-0.1.0 lib/bandwidth/voice_lib/voice/bxml/bxml.rb