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)
25 26 27 |
# File 'lib/lutaml/qea/models/ea_complexity_type.rb', line 25 def self.primary_key_column "Complexity" end |
.table_name ⇒ Object
20 21 22 |
# File 'lib/lutaml/qea/models/ea_complexity_type.rb', line 20 def self.table_name "t_complexitytypes" end |
Instance Method Details
#<=>(other) ⇒ Integer
Compare complexity levels by numeric weight
71 72 73 74 75 |
# File 'lib/lutaml/qea/models/ea_complexity_type.rb', line 71 def <=>(other) return 0 unless other.is_a?(EaComplexityType) weight <=> other.weight end |
#extreme? ⇒ Boolean
Check if this is extreme complexity
64 65 66 |
# File 'lib/lutaml/qea/models/ea_complexity_type.rb', line 64 def extreme? complexity == "Extreme" end |
#high? ⇒ Boolean
Check if this is high complexity
58 59 60 |
# File 'lib/lutaml/qea/models/ea_complexity_type.rb', line 58 def high? complexity&.match?(/^(V\.)?High$/i) end |
#low? ⇒ Boolean
Check if this is low complexity
46 47 48 |
# File 'lib/lutaml/qea/models/ea_complexity_type.rb', line 46 def low? complexity&.match?(/^(V\.)?Low$/i) end |
#medium? ⇒ Boolean
Check if this is medium complexity
52 53 54 |
# File 'lib/lutaml/qea/models/ea_complexity_type.rb', line 52 def medium? complexity == "Medium" end |
#name ⇒ String
Friendly name for complexity
31 32 33 |
# File 'lib/lutaml/qea/models/ea_complexity_type.rb', line 31 def name complexity end |
#weight ⇒ Integer
Get numeric weight for sorting
40 41 42 |
# File 'lib/lutaml/qea/models/ea_complexity_type.rb', line 40 def weight numericweight || 0 end |