Class: Lutaml::Qea::Models::EaDiagramLink
- Inherits:
-
BaseModel
- Object
- Model::Serializable
- BaseModel
- Lutaml::Qea::Models::EaDiagramLink
- Defined in:
- lib/lutaml/qea/models/ea_diagram_link.rb
Overview
Represents a diagram link from the t_diagramlinks table
This model represents the visual rendering of connectors (associations, generalizations, etc.) on specific diagrams, including their routing geometry and styling.
Class Method Summary collapse
Instance Method Summary collapse
-
#hidden? ⇒ Boolean
Check if the link is hidden on the diagram.
-
#object_ids ⇒ Hash
Extract source and destination object IDs from style.
-
#parsed_geometry ⇒ Hash
Parse the Geometry string to extract routing points.
-
#parsed_style ⇒ Hash
Parse the Style string into a hash.
Methods inherited from BaseModel
Class Method Details
.primary_key_column ⇒ Object
22 23 24 |
# File 'lib/lutaml/qea/models/ea_diagram_link.rb', line 22 def self.primary_key_column :instance_id end |
.table_name ⇒ Object
26 27 28 |
# File 'lib/lutaml/qea/models/ea_diagram_link.rb', line 26 def self.table_name "t_diagramlinks" end |
Instance Method Details
#hidden? ⇒ Boolean
Check if the link is hidden on the diagram
32 33 34 |
# File 'lib/lutaml/qea/models/ea_diagram_link.rb', line 32 def hidden? hidden == 1 end |
#object_ids ⇒ Hash
Extract source and destination object IDs from style
70 71 72 73 74 75 76 |
# File 'lib/lutaml/qea/models/ea_diagram_link.rb', line 70 def object_ids parsed = parsed_style { source_oid: parsed["SOID"], dest_oid: parsed["EOID"], } end |
#parsed_geometry ⇒ Hash
Parse the Geometry string to extract routing points
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/lutaml/qea/models/ea_diagram_link.rb', line 49 def parsed_geometry # rubocop:disable Metrics/MethodLength return {} unless geometry parts = geometry.split(",") result = {} # First 4 values are typically coordinates if parts.length >= 4 result[:coords] = parts[0..3].map(&:strip).map(&:to_i) end # Remaining parts contain additional metadata if parts.length > 4 result[:metadata] = parts[4..].join(",") end result end |
#parsed_style ⇒ Hash
Parse the Style string into a hash
38 39 40 41 42 43 44 45 |
# File 'lib/lutaml/qea/models/ea_diagram_link.rb', line 38 def parsed_style return {} unless style style.split(";").each_with_object({}) do |pair, hash| key, value = pair.split("=", 2) hash[key] = value if key && value end end |