Class: Emarsys::Broadcast::XmlBuilder

Inherits:
Object
  • Object
show all
Includes:
Validation
Defined in:
lib/emarsys/broadcast/xml_builder.rb

Instance Method Summary collapse

Methods included from Validation

#string_present?, #within_range?

Instance Method Details

#import_xml(remote_path) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/emarsys/broadcast/xml_builder.rb', line 7

def import_xml(remote_path)
  xml = Nokogiri::XML::Builder.new do |xml|
    xml.importRequest {
      xml.filePath remote_path
    }
  end
  xml.to_xml
end

#sender_xml(sender) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/emarsys/broadcast/xml_builder.rb', line 16

def sender_xml(sender)
  xml = Nokogiri::XML::Builder.new do |xml|
    xml.sender {
      xml.name sender.name
      xml.address sender.address
    }
  end
  xml.to_xml
end