Class: Archimate::FileFormats::ModelExchangeFileWriter30

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::V30::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::V30::Property

#serialize_property

Methods included from Serializer::ModelExchangeFile::V30::OrganizationBody

#serialize_organization_body

Methods included from Serializer::ModelExchangeFile::Organization

#serialize_organization

Methods included from Serializer::ModelExchangeFile::V30::Model

#model_attrs, #serialize_model

Methods included from Serializer::ModelExchangeFile::Location

#serialize_location

Methods included from Serializer::ModelExchangeFile::V30::Label

#serialize_label

Methods included from Serializer::ModelExchangeFile::V30::Item

#serialize_item

Methods included from Serializer::ModelExchangeFile::Element

#elementbase, #serialize_element

Methods included from Serializer::ModelExchangeFile::V30::Diagram

#serialize_diagram

Methods included from Serializer::ModelExchangeFile::V30::Connection

#serialize_connection

Methods inherited from Serializer::ModelExchangeFile::ModelExchangeFileWriter

#identifier, #write

Methods inherited from Serializer::Writer

#serialize, write

Constructor Details

#initialize(model) ⇒ ModelExchangeFileWriter30

Returns a new instance of ModelExchangeFileWriter30.



22
23
24
# File 'lib/archimate/file_formats/model_exchange_file_writer_30.rb', line 22

def initialize(model)
  super
end

Instance Method Details

#font_style_string(font) ⇒ Object



37
38
39
40
41
42
43
44
45
46
# File 'lib/archimate/file_formats/model_exchange_file_writer_30.rb', line 37

def font_style_string(font)
  case font&.style
  when 1
    "italic"
  when 2
    "bold"
  when 3
    "bold italic"
  end
end

#meff_type(el_type) ⇒ Object



48
49
50
# File 'lib/archimate/file_formats/model_exchange_file_writer_30.rb', line 48

def meff_type(el_type)
  el_type.sub(/^/, "")
end

#relationship_attributes(relationship) ⇒ Object



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

def relationship_attributes(relationship)
  attrs = {
    identifier: identifier(relationship.id),
    source: identifier(relationship.source.id),
    target: identifier(relationship.target.id),
    "xsi:type" => meff_type(relationship.type)
  }
  attrs["accessType"] = relationship.access_type if relationship.access_type
  attrs
end