Class: Ea::Qea::Models::EaXref
- Defined in:
- lib/ea/qea/models/ea_xref.rb
Overview
Represents a cross-reference from the t_xref table in EA database Stores cross-references for stereotypes, properties, and relationships between UML elements
Constant Summary collapse
- COLUMN_MAP =
{ "XrefID" => :xref_id, "Type" => :xref_type, }.freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#attribute_property? ⇒ Boolean
Check if this xref is for attribute properties.
-
#connector_property? ⇒ Boolean
Check if this xref is for connector properties.
-
#custom_property? ⇒ Boolean
Check if this xref is for custom properties.
-
#diagram_property? ⇒ Boolean
Check if this xref is for diagram properties.
-
#element_property? ⇒ Boolean
Check if this xref is for element properties.
-
#parsed_description ⇒ Hash
Parse the Description field into structured data (legacy hash form).
-
#parsed_record ⇒ Ea::Sources::Qea::Xref::Record
Parse Description into a typed Record with named accessors.
-
#stereotype? ⇒ Boolean
Check if this xref is for stereotypes.
Methods inherited from BaseModel
from_db_row, #primary_key, #sort_position
Class Method Details
.column_map ⇒ Object
34 35 36 |
# File 'lib/ea/qea/models/ea_xref.rb', line 34 def self.column_map COLUMN_MAP end |
.primary_key_column ⇒ Object
20 21 22 |
# File 'lib/ea/qea/models/ea_xref.rb', line 20 def self.primary_key_column :xref_id end |
.table_name ⇒ Object
24 25 26 |
# File 'lib/ea/qea/models/ea_xref.rb', line 24 def self.table_name "t_xref" end |
Instance Method Details
#attribute_property? ⇒ Boolean
Check if this xref is for attribute properties
93 94 95 |
# File 'lib/ea/qea/models/ea_xref.rb', line 93 def attribute_property? xref_type == "attribute property" end |
#connector_property? ⇒ Boolean
Check if this xref is for connector properties
81 82 83 |
# File 'lib/ea/qea/models/ea_xref.rb', line 81 def connector_property? xref_type&.include?("connector") && xref_type.include?("property") end |
#custom_property? ⇒ Boolean
Check if this xref is for custom properties
69 70 71 |
# File 'lib/ea/qea/models/ea_xref.rb', line 69 def custom_property? !description&.include?("@STEREO") && !description&.include?("@TAG") end |
#diagram_property? ⇒ Boolean
Check if this xref is for diagram properties
87 88 89 |
# File 'lib/ea/qea/models/ea_xref.rb', line 87 def diagram_property? xref_type == "diagram properties" end |
#element_property? ⇒ Boolean
Check if this xref is for element properties
75 76 77 |
# File 'lib/ea/qea/models/ea_xref.rb', line 75 def element_property? xref_type == "element property" end |
#parsed_description ⇒ Hash
Parse the Description field into structured data (legacy hash form).
Kept for backward compatibility. New code should use
#parsed_record which returns a typed Xref::Record.
47 48 49 50 51 |
# File 'lib/ea/qea/models/ea_xref.rb', line 47 def parsed_description return @parsed_description if defined?(@parsed_description) @parsed_description = parse_description_field(description) end |
#parsed_record ⇒ Ea::Sources::Qea::Xref::Record
Parse Description into a typed Record with named accessors.
55 56 57 58 59 |
# File 'lib/ea/qea/models/ea_xref.rb', line 55 def parsed_record return @parsed_record if defined?(@parsed_record) @parsed_record = Sources::Qea::Xref::Parser.parse(description) end |
#stereotype? ⇒ Boolean
Check if this xref is for stereotypes
63 64 65 |
# File 'lib/ea/qea/models/ea_xref.rb', line 63 def stereotype? name == "Stereotypes" || description&.include?("@STEREO") end |