Module: Ea::Sources::Qea::ConnectorRelationshipMap
- Defined in:
- lib/ea/sources/qea/connector_relationship_map.rb
Overview
Maps EA's t_connector.Connector_Type discriminator to the
concrete Ea::Model::Relationship subclass. Adds new
relationship kinds by registering here (OCP).
Constant Summary collapse
- LOOKUP =
{ "Association" => "Ea::Model::Association", "Aggregation" => "Ea::Model::Association", "Composition" => "Ea::Model::Association", "Generalization" => "Ea::Model::Generalization", "Realization" => "Ea::Model::Realization", "Usage" => "Ea::Model::Dependency", "Dependency" => "Ea::Model::Dependency", "Abstraction" => "Ea::Model::Dependency" }.freeze
- AGGREGATION_FOR =
Some connector types imply specific aggregation values on the source end (EA stores them as separate Connector_Type values rather than as an attribute on the connector).
{ "Aggregation" => "shared", "Composition" => "composite" }.freeze
Class Method Summary collapse
Class Method Details
.class_for(connector_type) ⇒ Object
31 32 33 34 |
# File 'lib/ea/sources/qea/connector_relationship_map.rb', line 31 def class_for(connector_type) name = LOOKUP[connector_type] || "Ea::Model::Association" Object.const_get(name) end |
.source_aggregation_for(connector_type) ⇒ Object
36 37 38 |
# File 'lib/ea/sources/qea/connector_relationship_map.rb', line 36 def source_aggregation_for(connector_type) AGGREGATION_FOR[connector_type] || "none" end |