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
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/lutaml/qea/models/ea_xref.rb', line 31 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
19 20 21 |
# File 'lib/lutaml/qea/models/ea_xref.rb', line 19 def self.primary_key_column :xref_id end |
.table_name ⇒ Object
23 24 25 |
# File 'lib/lutaml/qea/models/ea_xref.rb', line 23 def self.table_name "t_xref" end |
Instance Method Details
#attribute_property? ⇒ Boolean
Check if this xref is for attribute properties
89 90 91 |
# File 'lib/lutaml/qea/models/ea_xref.rb', line 89 def attribute_property? xref_type == "attribute property" end |
#connector_property? ⇒ Boolean
Check if this xref is for connector properties
77 78 79 |
# File 'lib/lutaml/qea/models/ea_xref.rb', line 77 def connector_property? xref_type&.include?("connector") && xref_type.include?("property") end |
#custom_property? ⇒ Boolean
Check if this xref is for custom properties
65 66 67 |
# File 'lib/lutaml/qea/models/ea_xref.rb', line 65 def custom_property? !description&.include?("@STEREO") && !description&.include?("@TAG") end |
#diagram_property? ⇒ Boolean
Check if this xref is for diagram properties
83 84 85 |
# File 'lib/lutaml/qea/models/ea_xref.rb', line 83 def diagram_property? xref_type == "diagram properties" end |
#element_property? ⇒ Boolean
Check if this xref is for element properties
71 72 73 |
# File 'lib/lutaml/qea/models/ea_xref.rb', line 71 def element_property? xref_type == "element property" end |
#parsed_description ⇒ Hash
Parse the Description field into structured data
51 52 53 54 55 |
# File 'lib/lutaml/qea/models/ea_xref.rb', line 51 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
59 60 61 |
# File 'lib/lutaml/qea/models/ea_xref.rb', line 59 def stereotype? name == "Stereotypes" || description&.include?("@STEREO") end |