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



52
53
54
55
56
57
58
59
# File 'lib/lutaml/uml/top_element_attribute.rb', line 52

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



48
49
50
# File 'lib/lutaml/uml/top_element_attribute.rb', line 48

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