Class: Pixelletter::XMLBuilder
- Defined in:
- lib/pixelletter/request/xml_builder.rb
Instance Method Summary collapse
-
#create_xml(*args) ⇒ Object
args = [ => { email: ‘[email protected]’, password: ‘password’, … }, => { … } ].
-
#initialize ⇒ XMLBuilder
constructor
A new instance of XMLBuilder.
Constructor Details
#initialize ⇒ XMLBuilder
Returns a new instance of XMLBuilder.
6 7 8 |
# File 'lib/pixelletter/request/xml_builder.rb', line 6 def initialize super end |
Instance Method Details
#create_xml(*args) ⇒ Object
args = [ => { email: ‘[email protected]’, password: ‘password’, … },
{:options => { ... }}
]
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/pixelletter/request/xml_builder.rb', line 17 def create_xml(*args) xml = Builder::XmlMarkup.new( :indent => 2 ); false xml.instruct! :xml, :encoding => "UTF-8" xml.tag! "pixelletter", version: '1.0' do args.flatten.each do |element| xml = build_subparts(xml, element) end end finalize_xml(xml) end |