Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/lutaml/lml/document_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ def expand_nested_members(model, hash)
# `value` members, mapping sections, class declarations, enum
# member_fields and from_table all arrive as bare member hashes.
def expand_declared_members(model, hash)
expand_abstract_declaration(model, hash)
expand_definition_text(model, hash)
expand_value_declaration(model, hash)
expand_value_set_declaration(model, hash)
Expand Down Expand Up @@ -287,6 +288,16 @@ def normalize_operation_param(param)

# RS 3001 §Definition single-line form (`definition "text"`) arrives
# as a quoted-string capture; unwrap it for the entity's definition.
# RS 3001 declaration modifiers: `abstract true` maps onto the
# is_abstract field (the visibility declaration flows through the
# generic attribute path).
def expand_abstract_declaration(model, hash)
value = hash.delete(:abstract)
return unless value && model.class.attributes.key?(:is_abstract)

model.is_abstract = value.to_s == 'true'
end

def expand_definition_text(model, hash)
return unless hash.key?(:definition) && model.class.attributes.key?(:definition)

Expand Down
3 changes: 2 additions & 1 deletion lib/lutaml/lml/formatter/graphviz/node_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ module NodeFormatter
ACCESS_SYMBOLS = {
'public' => '+',
'protected' => '#',
'private' => '-'
'private' => '-',
'package' => '~'
}.freeze

def format_attribute(node)
Expand Down
Loading
Loading