Module: Lutaml::Lml::EntityTypes
- Defined in:
- lib/lutaml/lml/entity_types.rb
Overview
Single source of truth for entity types held on a Document. Each entity model declares self.entity_type (the Document collection name); consumers iterate this registry instead of hardcoding the type list in four places.
Constant Summary collapse
- ALL =
[UmlClass, Enum, DataType, PrimitiveType].freeze
Class Method Summary collapse
- .all ⇒ Object
- .by_symbol ⇒ Object
-
.classifiable ⇒ Object
Entities that can own attributes/associations (excludes enums).
- .symbols ⇒ Object
Class Method Details
.all ⇒ Object
12 13 14 |
# File 'lib/lutaml/lml/entity_types.rb', line 12 def self.all ALL end |
.by_symbol ⇒ Object
16 17 18 |
# File 'lib/lutaml/lml/entity_types.rb', line 16 def self.by_symbol @by_symbol ||= ALL.each_with_object({}) { |klass, index| index[klass.entity_type] = klass } end |
.classifiable ⇒ Object
Entities that can own attributes/associations (excludes enums).
25 26 27 |
# File 'lib/lutaml/lml/entity_types.rb', line 25 def self.classifiable ALL.select(&:classifiable?) end |
.symbols ⇒ Object
20 21 22 |
# File 'lib/lutaml/lml/entity_types.rb', line 20 def self.symbols by_symbol.keys end |