Class: Lutaml::Qea::Models::EaOperation

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

Overview

Represents an operation from the t_operation table in EA database This represents class methods/operations

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#primary_key

Class Method Details

.from_db_row(row) ⇒ EaOperation?

Create from database row

Parameters:

  • row (Hash)

    Database row with string keys

Returns:

  • (EaOperation, nil)

    New instance or nil if row is nil



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/lutaml/qea/models/ea_operation.rb', line 49

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

  new(
    operationid: row["OperationID"],
    ea_object_id: row["Object_ID"],
    name: row["Name"],
    scope: row["Scope"],
    type: row["Type"],
    returnarray: row["ReturnArray"],
    stereotype: row["Stereotype"],
    isstatic: row["IsStatic"],
    concurrency: row["Concurrency"],
    notes: row["Notes"],
    behaviour: row["Behaviour"],
    abstract: row["Abstract"],
    genoption: row["GenOption"],
    synchronized: row["Synchronized"],
    pos: row["Pos"],
    const: row["Const"],
    style: row["Style"],
    pure: row["Pure"],
    throws: row["Throws"],
    classifier: row["Classifier"],
    code: row["Code"],
    isroot: row["IsRoot"],
    isleaf: row["IsLeaf"],
    isquery: row["IsQuery"],
    stateflags: row["StateFlags"],
    ea_guid: row["ea_guid"],
    styleex: row["StyleEx"],
  )
end

.primary_key_columnObject



37
38
39
# File 'lib/lutaml/qea/models/ea_operation.rb', line 37

def self.primary_key_column
  :operationid
end

.table_nameObject



41
42
43
# File 'lib/lutaml/qea/models/ea_operation.rb', line 41

def self.table_name
  "t_operation"
end

Instance Method Details

#abstract?Boolean

Check if operation is abstract

Returns:

  • (Boolean)


91
92
93
# File 'lib/lutaml/qea/models/ea_operation.rb', line 91

def abstract?
  abstract == "1"
end

#constant?Boolean

Check if operation is constant

Returns:

  • (Boolean)


127
128
129
# File 'lib/lutaml/qea/models/ea_operation.rb', line 127

def constant?
  const == 1
end

#leaf?Boolean

Check if operation is leaf

Returns:

  • (Boolean)


121
122
123
# File 'lib/lutaml/qea/models/ea_operation.rb', line 121

def leaf?
  isleaf == 1
end

#private?Boolean

Check if operation is private

Returns:

  • (Boolean)


139
140
141
# File 'lib/lutaml/qea/models/ea_operation.rb', line 139

def private?
  scope&.downcase == "private"
end

#protected?Boolean

Check if operation is protected

Returns:

  • (Boolean)


145
146
147
# File 'lib/lutaml/qea/models/ea_operation.rb', line 145

def protected?
  scope&.downcase == "protected"
end

#public?Boolean

Check if operation is public

Returns:

  • (Boolean)


133
134
135
# File 'lib/lutaml/qea/models/ea_operation.rb', line 133

def public?
  scope&.downcase == "public"
end

#pure?Boolean

Check if operation is pure virtual

Returns:

  • (Boolean)


103
104
105
# File 'lib/lutaml/qea/models/ea_operation.rb', line 103

def pure?
  pure == 1
end

#query?Boolean

Check if operation is a query

Returns:

  • (Boolean)


109
110
111
# File 'lib/lutaml/qea/models/ea_operation.rb', line 109

def query?
  isquery == 1
end

#root?Boolean

Check if operation is root

Returns:

  • (Boolean)


115
116
117
# File 'lib/lutaml/qea/models/ea_operation.rb', line 115

def root?
  isroot == 1
end

#static?Boolean

Check if operation is static

Returns:

  • (Boolean)


85
86
87
# File 'lib/lutaml/qea/models/ea_operation.rb', line 85

def static?
  isstatic == "1"
end

#synchronized?Boolean

Check if operation is synchronized

Returns:

  • (Boolean)


97
98
99
# File 'lib/lutaml/qea/models/ea_operation.rb', line 97

def synchronized?
  synchronized == "1"
end