Class: Lutaml::Qea::Models::EaXref
- Defined in:
- lib/lutaml/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
Class Method Summary collapse
-
.from_db_row(row) ⇒ EaXref?
Create from database row.
- .primary_key_column ⇒ Object
- .table_name ⇒ Object
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.
-
#stereotype? ⇒ Boolean
Check if this xref is for stereotypes.
Methods inherited from BaseModel
Class Method Details
.from_db_row(row) ⇒ EaXref?
Create from database row
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/lutaml/qea/models/ea_xref.rb', line 29 def self.from_db_row(row) return nil if row.nil? new( xref_id: row["XrefID"], name: row["Name"], xref_type: row["Type"], client: row["Client"], supplier: row["Supplier"], description: row["Description"], ) end |
.primary_key_column ⇒ Object
17 18 19 |
# File 'lib/lutaml/qea/models/ea_xref.rb', line 17 def self.primary_key_column :xref_id end |
.table_name ⇒ Object
21 22 23 |
# File 'lib/lutaml/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
87 88 89 |
# File 'lib/lutaml/qea/models/ea_xref.rb', line 87 def attribute_property? xref_type == "attribute property" end |
#connector_property? ⇒ Boolean
Check if this xref is for connector properties
75 76 77 |
# File 'lib/lutaml/qea/models/ea_xref.rb', line 75 def connector_property? xref_type&.include?("connector") && xref_type.include?("property") end |
#custom_property? ⇒ Boolean
Check if this xref is for custom properties
63 64 65 |
# File 'lib/lutaml/qea/models/ea_xref.rb', line 63 def custom_property? !description&.include?("@STEREO") && !description&.include?("@TAG") end |
#diagram_property? ⇒ Boolean
Check if this xref is for diagram properties
81 82 83 |
# File 'lib/lutaml/qea/models/ea_xref.rb', line 81 def diagram_property? xref_type == "diagram properties" end |
#element_property? ⇒ Boolean
Check if this xref is for element properties
69 70 71 |
# File 'lib/lutaml/qea/models/ea_xref.rb', line 69 def element_property? xref_type == "element property" end |
#parsed_description ⇒ Hash
Parse the Description field into structured data
49 50 51 52 53 |
# File 'lib/lutaml/qea/models/ea_xref.rb', line 49 def parsed_description return @parsed_description if defined?(@parsed_description) @parsed_description = parse_description_field(description) end |
#stereotype? ⇒ Boolean
Check if this xref is for stereotypes
57 58 59 |
# File 'lib/lutaml/qea/models/ea_xref.rb', line 57 def stereotype? name == "Stereotypes" || description&.include?("@STEREO") end |