Class: Lutaml::Uml::TopElementAttribute

Inherits:
Model::Serializable
  • Object
show all
Defined in:
lib/lutaml/uml/top_element_attribute.rb

Instance Method Summary collapse

Instance Method Details

#definition_from_yaml(model, value) ⇒ Object



48
49
50
51
52
53
54
55
# File 'lib/lutaml/uml/top_element_attribute.rb', line 48

def definition_from_yaml(model, value)
  model.definition = value.to_s
    .gsub(/\\}/, "}")
    .gsub(/\\{/, "{")
    .split("\n")
    .map(&:strip)
    .join("\n")
end

#definition_to_yaml(model, doc) ⇒ Object



44
45
46
# File 'lib/lutaml/uml/top_element_attribute.rb', line 44

def definition_to_yaml(model, doc)
  doc["definition"] = model.definition if model.definition
end