iab-FinancialProductBuilder 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/productconfig.rb +7 -6
- metadata +1 -1
data/lib/productconfig.rb
CHANGED
@@ -23,7 +23,7 @@ class ProductConfig
|
|
23
23
|
|
24
24
|
(dataelements.collect {|x| x if x.type == "coverages"}).compact.each do |e|
|
25
25
|
text = "coverage :#{e.name}\n"
|
26
|
-
text << getFields(e,1,e.name)
|
26
|
+
text << getFields(nil,e,1,e.name)
|
27
27
|
text << "endcoverage"
|
28
28
|
a = Array.new
|
29
29
|
a.push e.name
|
@@ -33,7 +33,7 @@ class ProductConfig
|
|
33
33
|
|
34
34
|
(dataelements.collect {|x| x if x.type == "entities"}).compact.each do |e|
|
35
35
|
text = "entity :#{e.name}\n"
|
36
|
-
text << getFields(e,1,e.name)
|
36
|
+
text << getFields(nil,e,1,e.name)
|
37
37
|
text << "endentity"
|
38
38
|
a = Array.new
|
39
39
|
a.push e.name
|
@@ -44,19 +44,20 @@ class ProductConfig
|
|
44
44
|
result
|
45
45
|
end
|
46
46
|
|
47
|
-
def getFields(e,depth,topLevelName)
|
47
|
+
def getFields(parent,e,depth,topLevelName)
|
48
48
|
text = ""
|
49
|
-
|
49
|
+
e.parent = parent if parent
|
50
50
|
if (e.fields and e.fields.length > 0)
|
51
51
|
e.fields.each do |f|
|
52
52
|
ename=""
|
53
53
|
ename = ":#{e.name}," if e.name != topLevelName
|
54
|
-
|
54
|
+
puts "pname=#{pname(e,",")},ename=#{ename}"
|
55
|
+
text << "\tuse "+"#{ename}:#{f[:name]}\n"
|
55
56
|
end
|
56
57
|
end
|
57
58
|
if (e.children and e.children.length > 0)
|
58
59
|
e.children.each do |c|
|
59
|
-
text << getFields(c,depth+1,topLevelName)
|
60
|
+
text << getFields(e,c,depth+1,topLevelName)
|
60
61
|
end
|
61
62
|
end
|
62
63
|
|