Class: Lutaml::Qea::Models::EaObject
- 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
-
.from_db_row(row) ⇒ EaObject?
Create from database row.
- .primary_key_column ⇒ Object
- .table_name ⇒ Object
Instance Method Summary collapse
-
#abstract? ⇒ Boolean
Check if object is abstract.
-
#component? ⇒ Boolean
Check if object is a Component.
-
#data_type? ⇒ Boolean
Check if object is a DataType.
-
#enumeration? ⇒ Boolean
Check if object is an Enumeration.
-
#instance? ⇒ Boolean
Check if object is an Instance (UML Object).
-
#interface? ⇒ Boolean
Check if object is an Interface.
-
#leaf? ⇒ Boolean
Check if object is leaf.
-
#package? ⇒ Boolean
Check if object is a Package.
-
#root? ⇒ Boolean
Check if object is root.
-
#uml_class? ⇒ Boolean
Check if object is a UML Class.
Methods inherited from BaseModel
Class Method Details
.from_db_row(row) ⇒ EaObject?
Create from database row
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 143 144 |
# File 'lib/lutaml/qea/models/ea_object.rb', line 82 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_column ⇒ Object
70 71 72 |
# File 'lib/lutaml/qea/models/ea_object.rb', line 70 def self.primary_key_column :ea_object_id end |
.table_name ⇒ Object
74 75 76 |
# File 'lib/lutaml/qea/models/ea_object.rb', line 74 def self.table_name "t_object" end |
Instance Method Details
#abstract? ⇒ Boolean
Check if object is abstract
148 149 150 |
# File 'lib/lutaml/qea/models/ea_object.rb', line 148 def abstract? abstract == "1" end |
#component? ⇒ Boolean
Check if object is a Component
166 167 168 |
# File 'lib/lutaml/qea/models/ea_object.rb', line 166 def component? object_type == "Component" end |
#data_type? ⇒ Boolean
Check if object is a DataType
184 185 186 |
# File 'lib/lutaml/qea/models/ea_object.rb', line 184 def data_type? object_type == "DataType" end |
#enumeration? ⇒ Boolean
Check if object is an Enumeration
178 179 180 |
# File 'lib/lutaml/qea/models/ea_object.rb', line 178 def enumeration? object_type == "Enumeration" end |
#instance? ⇒ Boolean
Check if object is an Instance (UML Object)
190 191 192 |
# File 'lib/lutaml/qea/models/ea_object.rb', line 190 def instance? object_type == "Object" end |
#interface? ⇒ Boolean
Check if object is an Interface
160 161 162 |
# File 'lib/lutaml/qea/models/ea_object.rb', line 160 def interface? object_type == "Interface" end |
#leaf? ⇒ Boolean
Check if object is leaf
202 203 204 |
# File 'lib/lutaml/qea/models/ea_object.rb', line 202 def leaf? isleaf == 1 end |
#package? ⇒ Boolean
Check if object is a Package
172 173 174 |
# File 'lib/lutaml/qea/models/ea_object.rb', line 172 def package? object_type == "Package" end |
#root? ⇒ Boolean
Check if object is root
196 197 198 |
# File 'lib/lutaml/qea/models/ea_object.rb', line 196 def root? isroot == 1 end |
#uml_class? ⇒ Boolean
Check if object is a UML Class
154 155 156 |
# File 'lib/lutaml/qea/models/ea_object.rb', line 154 def uml_class? object_type == "Class" end |