Class: Ea::Qea::Models::EaXref

Inherits:
BaseModel
  • Object
show all
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

Methods inherited from BaseModel

from_db_row, #primary_key, #sort_position

Class Method Details

.column_mapObject



31
32
33
# File 'lib/ea/qea/models/ea_xref.rb', line 31

def self.column_map
  COLUMN_MAP
end

.primary_key_columnObject



17
18
19
# File 'lib/ea/qea/models/ea_xref.rb', line 17

def self.primary_key_column
  :xref_id
end

.table_nameObject



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

Returns:

  • (Boolean)


80
81
82
# File 'lib/ea/qea/models/ea_xref.rb', line 80

def attribute_property?
  xref_type == "attribute property"
end

#connector_property?Boolean

Check if this xref is for connector properties

Returns:

  • (Boolean)


68
69
70
# File 'lib/ea/qea/models/ea_xref.rb', line 68

def connector_property?
  xref_type&.include?("connector") && xref_type.include?("property")
end

#custom_property?Boolean

Check if this xref is for custom properties

Returns:

  • (Boolean)


56
57
58
# File 'lib/ea/qea/models/ea_xref.rb', line 56

def custom_property?
  !description&.include?("@STEREO") && !description&.include?("@TAG")
end

#diagram_property?Boolean

Check if this xref is for diagram properties

Returns:

  • (Boolean)


74
75
76
# File 'lib/ea/qea/models/ea_xref.rb', line 74

def diagram_property?
  xref_type == "diagram properties"
end

#element_property?Boolean

Check if this xref is for element properties

Returns:

  • (Boolean)


62
63
64
# File 'lib/ea/qea/models/ea_xref.rb', line 62

def element_property?
  xref_type == "element property"
end

#parsed_descriptionHash

Parse the Description field into structured data

Returns:

  • (Hash)

    Parsed description data



42
43
44
45
46
# File 'lib/ea/qea/models/ea_xref.rb', line 42

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

Returns:

  • (Boolean)


50
51
52
# File 'lib/ea/qea/models/ea_xref.rb', line 50

def stereotype?
  name == "Stereotypes" || description&.include?("@STEREO")
end