Class: Lutaml::Qea::Factory::ObjectPropertyTransformer

Inherits:
BaseTransformer show all
Defined in:
lib/lutaml/qea/factory/object_property_transformer.rb

Overview

Transforms EA ObjectProperty to UML Property/TaggedValue

This transformer converts Enterprise Architect object properties (GML/XML Schema encoding metadata) to UML elements. Object properties are treated as specialized tagged values that enhance UML classes with schema-specific metadata.

Examples:

Transform an object property

ea_prop = Models::EaObjectProperty.new(
  property_id: 1,
  object_id: 684,
  property: "isCollection",
  value: "false"
)
transformer = ObjectPropertyTransformer.new
uml_tag = transformer.transform(ea_prop)

Instance Attribute Summary

Attributes inherited from BaseTransformer

#database

Instance Method Summary collapse

Methods inherited from BaseTransformer

#initialize, #transform_collection

Constructor Details

This class inherits a constructor from Lutaml::Qea::Factory::BaseTransformer

Instance Method Details

#transform(ea_property) ⇒ Lutaml::Uml::TaggedValue?

Transform EA object property to UML TaggedValue

Object properties enhance UML elements with GML/XML encoding metadata. They are transformed into tagged values to preserve this semantic information.

Parameters:

Returns:



34
35
36
37
38
39
40
41
42
43
# File 'lib/lutaml/qea/factory/object_property_transformer.rb', line 34

def transform(ea_property)
  return nil unless ea_property
  return nil unless ea_property.property

  Lutaml::Uml::TaggedValue.new.tap do |tag|
    tag.name = ea_property.property
    tag.value = ea_property.value || ""
    tag.notes = format_notes(ea_property)
  end
end