Class: Lutaml::Uml::TopElement

Inherits:
Object
  • Object
show all
Includes:
HasAttributes
Defined in:
lib/lutaml/uml/top_element.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HasAttributes

#update_attributes

Constructor Details

#initialize(attributes = {}) ⇒ TopElement

rubocop:disable Rails/ActiveRecordAliases



20
21
22
23
24
# File 'lib/lutaml/uml/top_element.rb', line 20

def initialize(attributes = {})
  @visibility = "public"
  @name = attributes["name"]
  update_attributes(attributes)
end

Instance Attribute Details

#commentsObject

Returns the value of attribute comments.



8
9
10
# File 'lib/lutaml/uml/top_element.rb', line 8

def comments
  @comments
end

#definitionObject

Returns the value of attribute definition.



8
9
10
# File 'lib/lutaml/uml/top_element.rb', line 8

def definition
  @definition
end

#hrefObject

Returns the value of attribute href.



8
9
10
# File 'lib/lutaml/uml/top_element.rb', line 8

def href
  @href
end

#keywordObject

Returns the value of attribute keyword.



8
9
10
# File 'lib/lutaml/uml/top_element.rb', line 8

def keyword
  @keyword
end

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/lutaml/uml/top_element.rb', line 8

def name
  @name
end

#namespaceObject

Returns the value of attribute namespace.



8
9
10
# File 'lib/lutaml/uml/top_element.rb', line 8

def namespace
  @namespace
end

#stereotypeObject

Returns the value of attribute stereotype.



8
9
10
# File 'lib/lutaml/uml/top_element.rb', line 8

def stereotype
  @stereotype
end

#visibilityObject

Returns the value of attribute visibility.



8
9
10
# File 'lib/lutaml/uml/top_element.rb', line 8

def visibility
  @visibility
end

#xmi_idObject

Returns the value of attribute xmi_id.



8
9
10
# File 'lib/lutaml/uml/top_element.rb', line 8

def xmi_id
  @xmi_id
end

#xmi_uuidObject

Returns the value of attribute xmi_uuid.



8
9
10
# File 'lib/lutaml/uml/top_element.rb', line 8

def xmi_uuid
  @xmi_uuid
end

Instance Method Details

#full_nameObject

rubocop:enable Rails/ActiveRecordAliases



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# 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?
                 "::#{the_name}"
               else
                 "#{next_namespace.name}::#{the_name}"
               end
    next_namespace = next_namespace.namespace
  end

  the_name
end