Class: Lutaml::Lml::UmlClass

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.classifiable?Boolean

Returns:

  • (Boolean)


72
73
74
# File 'lib/lutaml/lml/models/uml_class.rb', line 72

def self.classifiable?
  true
end

.entity_typeObject



68
69
70
# File 'lib/lutaml/lml/models/uml_class.rb', line 68

def self.entity_type
  :classes
end

Instance Method Details

#associations_from_yaml(model, values) ⇒ Object



59
60
61
62
63
64
65
66
# File 'lib/lutaml/lml/models/uml_class.rb', line 59

def associations_from_yaml(model, values)
  associations = values.map do |value|
    value["owner_end"] = model.name if value["owner_end"].nil?
    Association.from_yaml(value.to_yaml)
  end

  model.associations = associations
end

#associations_to_yaml(model, doc) ⇒ Object



52
53
54
55
56
57
# File 'lib/lutaml/lml/models/uml_class.rb', line 52

def associations_to_yaml(model, doc)
  return unless model.associations

  associations = model.associations.map(&:to_hash)
  doc["associations"] = associations unless associations.empty?
end