summaryrefslogtreecommitdiff
path: root/contrib/smsweb/smswsc/builder.rb
blob: a6e25a9ac1fa938b9a5a1b1525f3b2299b807de8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'builder'

module SMSWSC
  XmlOptions = {
    :version => "1.0",
    :encoding => "UTF-8",
    :indent => 0,
  }

  def self.new_builder(xml)
    builder = Builder::XmlMarkup.new(
      :target => xml,
      :indent => SMSWSC::XmlOptions[:indent]
    )
    builder.instruct!(
      :xml,
      :version => SMSWSC::XmlOptions[:version],
      :encoding => SMSWSC::XmlOptions[:encoding]
    )

    return builder
  end
end