Class: Lutaml::Qea::Models::EaComplexityType
- Inherits:
-
BaseModel
- Object
- Model::Serializable
- BaseModel
- Lutaml::Qea::Models::EaComplexityType
- Defined in:
- lib/lutaml/qea/models/ea_complexity_type.rb
Overview
Represents a complexity type definition from t_complexitytypes table
This table provides reference data for complexity levels that can be assigned to UML elements. Each complexity has a numeric weight for sorting/comparison.
Class Method Summary collapse
-
.primary_key_column ⇒ Object
Primary key is Complexity (text).
- .table_name ⇒ Object
Instance Method Summary collapse
-
#<=>(other) ⇒ Integer
Compare complexity levels by numeric weight.
-
#extreme? ⇒ Boolean
Check if this is extreme complexity.
-
#high? ⇒ Boolean
Check if this is high complexity.
-
#low? ⇒ Boolean
Check if this is low complexity.
-
#medium? ⇒ Boolean
Check if this is medium complexity.
-
#name ⇒ String
Friendly name for complexity.
-
#weight ⇒ Integer
Get numeric weight for sorting.
Methods inherited from BaseModel
Class Method Details
.primary_key_column ⇒ Object
Primary key is Complexity (text)
27 28 29 |
# File 'lib/lutaml/qea/models/ea_complexity_type.rb', line 27 def self.primary_key_column "Complexity" end |
.table_name ⇒ Object
22 23 24 |
# File 'lib/lutaml/qea/models/ea_complexity_type.rb', line 22 def self.table_name "t_complexitytypes" end |
Instance Method Details
#<=>(other) ⇒ Integer
Compare complexity levels by numeric weight
73 74 75 76 77 |
# File 'lib/lutaml/qea/models/ea_complexity_type.rb', line 73 def <=>(other) return 0 unless other.is_a?(EaComplexityType) weight <=> other.weight end |
#extreme? ⇒ Boolean
Check if this is extreme complexity
66 67 68 |
# File 'lib/lutaml/qea/models/ea_complexity_type.rb', line 66 def extreme? complexity == "Extreme" end |
#high? ⇒ Boolean
Check if this is high complexity
60 61 62 |
# File 'lib/lutaml/qea/models/ea_complexity_type.rb', line 60 def high? complexity&.match?(/^(V\.)?High$/i) end |
#low? ⇒ Boolean
Check if this is low complexity
48 49 50 |
# File 'lib/lutaml/qea/models/ea_complexity_type.rb', line 48 def low? complexity&.match?(/^(V\.)?Low$/i) end |
#medium? ⇒ Boolean
Check if this is medium complexity
54 55 56 |
# File 'lib/lutaml/qea/models/ea_complexity_type.rb', line 54 def medium? complexity == "Medium" end |
#name ⇒ String
Friendly name for complexity
33 34 35 |
# File 'lib/lutaml/qea/models/ea_complexity_type.rb', line 33 def name complexity end |
#weight ⇒ Integer
Get numeric weight for sorting
42 43 44 |
# File 'lib/lutaml/qea/models/ea_complexity_type.rb', line 42 def weight numericweight || 0 end |