Class: Lutaml::Qea::Models::EaObject

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/lutaml/qea/models/ea_object.rb

Overview

Represents an object from the t_object table in EA database This is the core entity representing classes, interfaces, components, etc.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#primary_key

Class Method Details

.from_db_row(row) ⇒ EaObject?

Create from database row

Parameters:

  • row (Hash)

    Database row with string keys

Returns:

  • (EaObject, nil)

    New instance or nil if row is nil



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/lutaml/qea/models/ea_object.rb', line 80

def self.from_db_row(row) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
  return nil if row.nil?

  new(
    ea_object_id: row["Object_ID"],
    object_type: row["Object_Type"],
    diagram_id: row["Diagram_ID"],
    name: row["Name"],
    alias: row["Alias"],
    author: row["Author"],
    version: row["Version"],
    note: row["Note"],
    package_id: row["Package_ID"],
    stereotype: row["Stereotype"],
    ntype: row["NType"],
    complexity: row["Complexity"],
    effort: row["Effort"],
    style: row["Style"],
    backcolor: row["BackColor"],
    borderstyle: row["BorderStyle"],
    borderwidth: row["BorderWidth"],
    fontcolor: row["Fontcolor"],
    bordercolor: row["Bordercolor"],
    createddate: row["CreatedDate"],
    modifieddate: row["ModifiedDate"],
    status: row["Status"],
    abstract: row["Abstract"],
    tagged: row["Tagged"],
    pdata1: row["PDATA1"],
    pdata2: row["PDATA2"],
    pdata3: row["PDATA3"],
    pdata4: row["PDATA4"],
    pdata5: row["PDATA5"],
    concurrency: row["Concurrency"],
    visibility: row["Visibility"],
    persistence: row["Persistence"],
    cardinality: row["Cardinality"],
    gentype: row["GenType"],
    genfile: row["GenFile"],
    header1: row["Header1"],
    header2: row["Header2"],
    phase: row["Phase"],
    scope: row["Scope"],
    genoption: row["GenOption"],
    genlinks: row["GenLinks"],
    classifier: row["Classifier"],
    ea_guid: row["ea_guid"],
    parentid: row["ParentID"],
    runstate: row["RunState"],
    classifier_guid: row["Classifier_guid"],
    tpos: row["TPos"],
    isroot: row["IsRoot"],
    isleaf: row["IsLeaf"],
    isspec: row["IsSpec"],
    isactive: row["IsActive"],
    stateflags: row["StateFlags"],
    packageflags: row["PackageFlags"],
    multiplicity: row["Multiplicity"],
    styleex: row["StyleEx"],
    actionflags: row["ActionFlags"],
    eventflags: row["EventFlags"],
  )
end

.primary_key_columnObject



68
69
70
# File 'lib/lutaml/qea/models/ea_object.rb', line 68

def self.primary_key_column
  :ea_object_id
end

.table_nameObject



72
73
74
# File 'lib/lutaml/qea/models/ea_object.rb', line 72

def self.table_name
  "t_object"
end

Instance Method Details

#abstract?Boolean

Check if object is abstract

Returns:

  • (Boolean)


146
147
148
# File 'lib/lutaml/qea/models/ea_object.rb', line 146

def abstract?
  abstract == "1"
end

#component?Boolean

Check if object is a Component

Returns:

  • (Boolean)


164
165
166
# File 'lib/lutaml/qea/models/ea_object.rb', line 164

def component?
  object_type == "Component"
end

#data_type?Boolean

Check if object is a DataType

Returns:

  • (Boolean)


182
183
184
# File 'lib/lutaml/qea/models/ea_object.rb', line 182

def data_type?
  object_type == "DataType"
end

#enumeration?Boolean

Check if object is an Enumeration

Returns:

  • (Boolean)


176
177
178
# File 'lib/lutaml/qea/models/ea_object.rb', line 176

def enumeration?
  object_type == "Enumeration"
end

#instance?Boolean

Check if object is an Instance (UML Object)

Returns:

  • (Boolean)


188
189
190
# File 'lib/lutaml/qea/models/ea_object.rb', line 188

def instance?
  object_type == "Object"
end

#interface?Boolean

Check if object is an Interface

Returns:

  • (Boolean)


158
159
160
# File 'lib/lutaml/qea/models/ea_object.rb', line 158

def interface?
  object_type == "Interface"
end

#leaf?Boolean

Check if object is leaf

Returns:

  • (Boolean)


200
201
202
# File 'lib/lutaml/qea/models/ea_object.rb', line 200

def leaf?
  isleaf == 1
end

#package?Boolean

Check if object is a Package

Returns:

  • (Boolean)


170
171
172
# File 'lib/lutaml/qea/models/ea_object.rb', line 170

def package?
  object_type == "Package"
end

#root?Boolean

Check if object is root

Returns:

  • (Boolean)


194
195
196
# File 'lib/lutaml/qea/models/ea_object.rb', line 194

def root?
  isroot == 1
end

#uml_class?Boolean

Check if object is a UML Class

Returns:

  • (Boolean)


152
153
154
# File 'lib/lutaml/qea/models/ea_object.rb', line 152

def uml_class?
  object_type == "Class"
end