45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# File 'lib/adf.rb', line 45
def to_xml
xml = Builder::XmlMarkup.new( :indent => 2 )
xml.instruct! :xml, :encoding => "UTF-8"
xml.instruct! :adf, :version => "1.0"
xml.adf do |adf|
@prospects.each do |prospect|
xml.prospect do |p|
p.request_date prospect.request_date
p.customer do |customer|
customer.contact do |contact|
contact.name(prospect.customer_first, "part" => "first") if not prospect.customer_first.nil?
contact.name(prospect.customer_last, "part" => "last") if not prospect.customer_last.nil?
contact.phone(prospect.customer_phone) if not prospect.customer_phone.nil?
contact.email(prospect.customer_email) if not prospect.customer_email.nil?
end
end
end
end
end
return xml.target!
end
|