9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/archimate/file_formats/serializer/model_exchange_file/v21/model.rb', line 9
def serialize_model(xml, model)
xml.model(model_attrs) do
Serializer::XmlMetadata.new(model.metadata).serialize(xml)
Serializer::XmlLangString.new(model.name, :name).serialize(xml)
Serializer::XmlLangString.new(model.documentation, :documentation).serialize(xml)
serialize_properties(xml, model)
Serializer::NamedCollection.new("elements", model.elements).serialize(xml) { |xml_e, elements| serialize(xml_e, elements) }
Serializer::NamedCollection.new("relationships", model.relationships).serialize(xml) { |xml_r, relationships| serialize(xml_r, relationships) }
NamedCollection.new("organization", model.organizations).serialize(xml) { |xml_o, orgs| serialize(xml_o, orgs) }
Serializer::XmlPropertyDefs.new(model.property_definitions).serialize(xml)
NamedCollection.new("views", model.diagrams).serialize(xml) do |xml_v, diagrams|
serialize(xml_v, diagrams)
end
end
end
|