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
31 32 33 |
# File 'lib/ea/qea/models/ea_xref.rb', line 31 def self.column_map COLUMN_MAP end |
.primary_key_column ⇒ Object
17 18 19 |
# File 'lib/ea/qea/models/ea_xref.rb', line 17 def self.primary_key_column :xref_id end |
.table_name ⇒ Object
21 22 23 |
# File 'lib/ea/qea/models/ea_xref.rb', line 21 def self.table_name "t_xref" end |
Instance Method Details
#attribute_property? ⇒ Boolean
Check if this xref is for attribute properties
90 91 92 |
# File 'lib/ea/qea/models/ea_xref.rb', line 90 def attribute_property? xref_type == "attribute property" end |
#connector_property? ⇒ Boolean
Check if this xref is for connector properties
78 79 80 |
# File 'lib/ea/qea/models/ea_xref.rb', line 78 def connector_property? xref_type&.include?("connector") && xref_type.include?("property") end |
#custom_property? ⇒ Boolean
Check if this xref is for custom properties
66 67 68 |
# File 'lib/ea/qea/models/ea_xref.rb', line 66 def custom_property? !description&.include?("@STEREO") && !description&.include?("@TAG") end |
#diagram_property? ⇒ Boolean
Check if this xref is for diagram properties
84 85 86 |
# File 'lib/ea/qea/models/ea_xref.rb', line 84 def diagram_property? xref_type == "diagram properties" end |
#element_property? ⇒ Boolean
Check if this xref is for element properties
72 73 74 |
# File 'lib/ea/qea/models/ea_xref.rb', line 72 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.
44 45 46 47 48 |
# File 'lib/ea/qea/models/ea_xref.rb', line 44 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.
52 53 54 55 56 |
# File 'lib/ea/qea/models/ea_xref.rb', line 52 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
60 61 62 |
# File 'lib/ea/qea/models/ea_xref.rb', line 60 def stereotype? name == "Stereotypes" || description&.include?("@STEREO") end |