Class: Archimate::FileFormats::Serializer::ModelExchangeFile::V30::PropertyDefinitions

Inherits:
Object
  • Object
show all
Defined in:
lib/archimate/file_formats/serializer/model_exchange_file/v30/property_definitions.rb

Overview

Property Definitions as defined in ArchiMate 3.0 Model Exchange XSDs

Instance Method Summary collapse

Constructor Details

#initialize(property_defs) ⇒ PropertyDefinitions

Returns a new instance of PropertyDefinitions.



10
11
12
# File 'lib/archimate/file_formats/serializer/model_exchange_file/v30/property_definitions.rb', line 10

def initialize(property_defs)
  @property_definitions = property_defs
end

Instance Method Details

#serialize(xml) ⇒ Object



14
15
16
17
18
19
# File 'lib/archimate/file_formats/serializer/model_exchange_file/v30/property_definitions.rb', line 14

def serialize(xml)
  return if @property_definitions.empty?
  xml.propertyDefinitions do
    @property_definitions.each { |property_def| serialize_property_definition(xml, property_def) }
  end
end

#serialize_property_definition(xml, property_def) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/archimate/file_formats/serializer/model_exchange_file/v30/property_definitions.rb', line 21

def serialize_property_definition(xml, property_def)
  xml.propertyDefinition(
    "identifier" => property_def.id,
    "type" => property_def.type
  ) do
    XmlLangString.new(property_def.name, :name).serialize(xml)
  end
end