Module: Archimate::FileFormats::Serializer::Archi::Connection
- Included in:
- ArchiFileWriter
- Defined in:
- lib/archimate/file_formats/serializer/archi/connection.rb
Instance Method Summary collapse
- #serialize_bendpoint(xml, bendpoint, connection) ⇒ Object
- #serialize_connection(xml, connection) ⇒ Object
Instance Method Details
#serialize_bendpoint(xml, bendpoint, connection) ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/archimate/file_formats/serializer/archi/connection.rb', line 30 def serialize_bendpoint(xml, bendpoint, connection) xml.bendpoint( { startX: (bendpoint.x - connection.start_location.x).to_i, startY: (bendpoint.y - connection.start_location.y).to_i, endX: (bendpoint.x - connection.end_location.x).to_i, endY: (bendpoint.y - connection.end_location.y).to_i }.delete_if { |_k, v| v.zero? } ) end |
#serialize_connection(xml, connection) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/archimate/file_formats/serializer/archi/connection.rb', line 8 def serialize_connection(xml, connection) xml.sourceConnection( { "xsi:type" => connection.type, "id" => connection.id, "name" => connection.name }.merge( archi_style_hash(connection.style).merge( "source" => connection.source&.id, "target" => connection.target&.id, "archimateRelationship" => connection.relationship&.id ) ).compact ) do connection.bendpoints.each do |bendpoint| serialize_bendpoint(xml, bendpoint, connection) end serialize_documentation(xml, connection.documentation) serialize(xml, connection.properties) end end |