class Lutaml::Uml::TopElement

Attributes

comments[RW]
definition[RW]
href[RW]
keyword[RW]
name[RW]
namespace[RW]
stereotype[RW]
visibility[RW]
xmi_id[RW]
xmi_uuid[RW]

Public Class Methods

new(attributes = {}) click to toggle source

rubocop:disable Rails/ActiveRecordAliases

# File lib/lutaml/uml/top_element.rb, line 20
def initialize(attributes = {})
  @visibility = "public"
  @name = attributes["name"]
  update_attributes(attributes)
end

Public Instance Methods

definition=(value) click to toggle source
# File lib/lutaml/uml/top_element.rb, line 47
def definition=(value)
  @definition = value
                  .to_s
                  .gsub(/\\}/, '}')
                  .gsub(/\\{/, '{')
                  .split("\n")
                  .map(&:strip)
                  .join("\n")
end
full_name() click to toggle source

rubocop:enable Rails/ActiveRecordAliases

# File lib/lutaml/uml/top_element.rb, line 27
def full_name
  if name == nil
    return nil
  end

  the_name = name
  next_namespace = namespace

  while !next_namespace.nil?
    the_name = if !next_namespace.name.nil?
                 next_namespace.name + "::" + the_name
               else
                 "::" + the_name
               end
    next_namespace = next_namespace.namespace
  end

  the_name
end