Class: Archimate::FileFormats::ModelExchangeFileWriter21

Overview

Archimate version 2.1 Model Exchange Format Writer

Instance Attribute Summary

Attributes inherited from Serializer::ModelExchangeFile::ModelExchangeFileWriter

#model

Attributes inherited from Serializer::Writer

#model

Instance Method Summary collapse

Methods included from Serializer::ModelExchangeFile::V21::ViewNode

#serialize_view_node, #view_node_attrs

Methods included from Serializer::ModelExchangeFile::Style

#serialize_color, #serialize_font, #serialize_style

Methods included from Serializer::ModelExchangeFile::Relationship

#serialize_relationship

Methods included from Serializer::ModelExchangeFile::Properties

#serialize_properties

Methods included from Serializer::ModelExchangeFile::V21::Property

#serialize_property

Methods included from Serializer::ModelExchangeFile::V21::OrganizationBody

#serialize_organization_body

Methods included from Serializer::ModelExchangeFile::Organization

#serialize_organization

Methods included from Serializer::ModelExchangeFile::V21::Model

#model_attrs, #serialize_model

Methods included from Serializer::ModelExchangeFile::Location

#serialize_location

Methods included from Serializer::ModelExchangeFile::V21::Label

#serialize_label

Methods included from Serializer::ModelExchangeFile::V21::Item

#serialize_item

Methods included from Serializer::ModelExchangeFile::Element

#elementbase, #serialize_element

Methods included from Serializer::ModelExchangeFile::V21::Diagram

#serialize_diagram

Methods included from Serializer::ModelExchangeFile::V21::Connection

#serialize_connection

Methods inherited from Serializer::ModelExchangeFile::ModelExchangeFileWriter

#identifier, #write

Methods inherited from Serializer::Writer

#remove_nil_values, #serialize, write

Constructor Details

#initialize(model) ⇒ ModelExchangeFileWriter21

Returns a new instance of ModelExchangeFileWriter21.



23
24
25
# File 'lib/archimate/file_formats/model_exchange_file_writer_21.rb', line 23

def initialize(model)
  super
end

Instance Method Details

#font_style_string(font) ⇒ Object



36
37
38
# File 'lib/archimate/file_formats/model_exchange_file_writer_21.rb', line 36

def font_style_string(font)
  font&.style_string
end

#meff_type(el_type) ⇒ Object



40
41
42
43
44
45
46
47
48
# File 'lib/archimate/file_formats/model_exchange_file_writer_21.rb', line 40

def meff_type(el_type)
  el_type = el_type.sub(/^/, "")
  case el_type
  when 'AndJunction', 'OrJunction'
    'Junction'
  else
    el_type
  end
end

#relationship_attributes(relationship) ⇒ Object



27
28
29
30
31
32
33
34
# File 'lib/archimate/file_formats/model_exchange_file_writer_21.rb', line 27

def relationship_attributes(relationship)
  {
    identifier: identifier(relationship.id),
    source: identifier(relationship.source.id),
    target: identifier(relationship.target.id),
    "xsi:type" => meff_type(relationship.type)
  }
end