Class: Lutaml::Uml::TopElement
- Inherits:
-
Model::Serializable
- Object
- Model::Serializable
- Lutaml::Uml::TopElement
show all
- Defined in:
- lib/lutaml/uml/top_element.rb
Direct Known Subclasses
Sysml::Allocated, Sysml::DeriveRequirement, Sysml::Refine, Sysml::RequirementRelated, Sysml::TestCase, Sysml::Trace, Association, Classifier, Connector, ConnectorEnd, Constraint, Dependency, Diagram, Event, Instance, Operation, Package, Property, Region, Transition, Trigger, Vertex
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.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.rb', line 44
def definition_to_yaml(model, doc)
doc["definition"] = model.definition if model.definition
end
|
#full_name_from_yaml(model, value) ⇒ Object
81
82
83
|
# File 'lib/lutaml/uml/top_element.rb', line 81
def full_name_from_yaml(model, value)
model.full_name = value
end
|
#full_name_to_yaml(model, doc) ⇒ Object
rubocop:disable Metrics/MethodLength
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# File 'lib/lutaml/uml/top_element.rb', line 57
def full_name_to_yaml(model, doc) return model.full_name if model.full_name
full_name = nil
if model.name == nil
return full_name
end
full_name = model.name
next_namespace = model.namespace
while !next_namespace.nil?
full_name = if next_namespace.name.nil?
"::#{full_name}"
else
"#{next_namespace.name}::#{full_name}"
end
next_namespace = next_namespace.namespace
end
doc["full_name"] = full_name
end
|