adf 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/adf.rb +12 -10
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80a21d41a50a0b9fadcc16e3259c437f33f26b82
4
- data.tar.gz: 3f9208451d5a8f3ac45edd30bf2f787642677877
3
+ metadata.gz: 54c14ae472f8ae86d4591ae482ab10c4ddec0be9
4
+ data.tar.gz: deb09292652d21dd85ea89245a87c6888a2205db
5
5
  SHA512:
6
- metadata.gz: 15ca7d57270b395ba32780610125215d42bc70abd5db37628a602fed5ad095d307ab008c67cf54401e53c4c87406e8b4e804103e92d9ea209bd49c888615ead3
7
- data.tar.gz: abece05dcd6f13983a9d651a7db9cfbca18c2f034e92208518c3c3adf281ab88a2e260808b4f4b242d5f5f035491a987a5a092bec5da0b2dc68629e5f0b52709
6
+ metadata.gz: 86bb2ea2e7c8599c8b5af6a126f444d4ed03bb8828c378570f840bc86245d98a65f911615a638e834193e660e96a6afc8378388b252942038341a728b6a2e4c1
7
+ data.tar.gz: c8130ce00f96aa23e36ca684391c582800703dcc3937584004bd3cfe5bff31315aa4ec7835036743779c0fbf6d97998a1af9ba3203e6beb407127556ee4c32aa
data/lib/adf.rb CHANGED
@@ -47,21 +47,23 @@ module ADF
47
47
  xml = Builder::XmlMarkup.new( :indent => 2 )
48
48
  xml.instruct! :xml, :encoding => "UTF-8"
49
49
  xml.instruct! :adf, :version => "1.0"
50
- @prospects.each do |prospect|
51
- xml.prospect do |p|
52
- p.request_date prospect.request_date
53
- p.customer do |customer|
54
- customer.contact do |contact|
55
- contact.name(prospect.customer_first, "part" => "first")
56
- contact.name(prospect.customer_last, "part" => "last")
57
- contact.phone(prospect.customer_phone)
58
- contact.email(prospect.customer_email)
50
+ xml.adf do |adf|
51
+ @prospects.each do |prospect|
52
+ xml.prospect do |p|
53
+ p.request_date prospect.request_date
54
+ p.customer do |customer|
55
+ customer.contact do |contact|
56
+ contact.name(prospect.customer_first, "part" => "first") if not prospect.customer_first.nil?
57
+ contact.name(prospect.customer_last, "part" => "last") if not prospect.customer_last.nil?
58
+ contact.phone(prospect.customer_phone) if not prospect.customer_phone.nil?
59
+ contact.email(prospect.customer_email) if not prospect.customer_email.nil?
60
+ end
59
61
  end
60
62
  end
61
63
  end
62
64
  end
63
65
 
64
- return xml
66
+ return xml.target!
65
67
  end
66
68
  end
67
69
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alagu
@@ -19,7 +19,7 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - lib/adf.rb
21
21
  - lib/prospect.rb
22
- homepage: http://rubygems.org/gems/adf
22
+ homepage: http://github.com/alagu/adf
23
23
  licenses:
24
24
  - MIT
25
25
  metadata: {}