Class: Lutaml::Lml::Document

Inherits:
Model::Serializable
  • Object
show all
Defined in:
lib/lutaml/lml/models/document.rb

Instance Method Summary collapse

Instance Method Details

#all_classesObject

All class-like entities on the document. Used by resolvers and formatters that need to walk every classifiable type without caring which collection holds it.



35
36
37
# File 'lib/lutaml/lml/models/document.rb', line 35

def all_classes
  EntityTypes.all.flat_map { |type| public_send(type.entity_type) }
end

#classifiable_classesObject

Class-like entities that can own associations. Excludes enums (which have no attributes/associations of their own).



41
42
43
# File 'lib/lutaml/lml/models/document.rb', line 41

def classifiable_classes
  EntityTypes.classifiable.flat_map { |type| public_send(type.entity_type) }
end