Class: Lutaml::Uml::Package

Inherits:
TopElement show all
Includes:
HasAttributes
Defined in:
lib/lutaml/uml/package.rb

Direct Known Subclasses

Model

Instance Attribute Summary collapse

Attributes inherited from TopElement

#comments, #definition, #href, #keyword, #name, #namespace, #stereotype, #visibility, #xmi_id, #xmi_uuid

Instance Method Summary collapse

Methods included from HasAttributes

#update_attributes

Methods inherited from TopElement

#full_name

Constructor Details

#initialize(attributes) ⇒ Package

Returns a new instance of Package.



11
12
13
14
# File 'lib/lutaml/uml/package.rb', line 11

def initialize(attributes)
  update_attributes(attributes)
  @children_packages ||= packages.map { |pkg| [pkg, pkg.packages, pkg.packages.map(&:children_packages)] }.flatten.uniq
end

Instance Attribute Details

#children_packagesObject (readonly)

Returns the value of attribute children_packages.



9
10
11
# File 'lib/lutaml/uml/package.rb', line 9

def children_packages
  @children_packages
end

#classesObject

Returns the value of attribute classes.



9
10
11
# File 'lib/lutaml/uml/package.rb', line 9

def classes
  @classes
end

#contentsObject

Returns the value of attribute contents.



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

def contents
  @contents
end

#data_typesObject

Returns the value of attribute data_types.



9
10
11
# File 'lib/lutaml/uml/package.rb', line 9

def data_types
  @data_types
end

#enumsObject

Returns the value of attribute enums.



9
10
11
# File 'lib/lutaml/uml/package.rb', line 9

def enums
  @enums
end

#importsObject

Returns the value of attribute imports.



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

def imports
  @imports
end

Instance Method Details

#diagramsObject



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

def diagrams
  @diagrams || []
end

#diagrams=(value) ⇒ Object



32
33
34
# File 'lib/lutaml/uml/package.rb', line 32

def diagrams=(value)
  @diagrams = value.to_a.map { |attributes| Diagram.new(attributes) }
end

#packagesObject



44
45
46
# File 'lib/lutaml/uml/package.rb', line 44

def packages
  @packages || []
end

#packages=(value) ⇒ Object



28
29
30
# File 'lib/lutaml/uml/package.rb', line 28

def packages=(value)
  @packages = value.to_a.map { |attributes| Package.new(attributes) }
end