8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/archimate/file_formats/serializer/archi/view_node.rb', line 8
def serialize_view_node(xml, child)
style_hash = archi_style_hash(child.style)
fill_color = style_hash.delete("fillColor")
xml.child(
remove_nil_values(
{
"xsi:type" => child.type,
"id" => child.id,
"name" => child.name
}.merge(
style_hash.merge(
"targetConnections" => child.target_connections.empty? ? nil : child.target_connections.join(" "),
"fillColor" => fill_color,
"model" => child.view_refs&.id,
"archimateElement" => child.element&.id,
"type" => child.child_type
)
)
)
) do
serialize_bounds(xml, child.bounds)
serialize(xml, child.connections)
xml.content { xml.text child.content } if child.content
serialize(xml, child.nodes)
serialize_documentation(xml, child.documentation)
serialize(xml, child.properties)
end
end
|