Class: Lutaml::XMI::PackageDrop

Inherits:
Liquid::Drop
  • Object
show all
Defined in:
lib/lutaml/xmi/liquid_drops/package_drop.rb

Instance Method Summary collapse

Constructor Details

#initialize(model, guidance = nil) ⇒ PackageDrop

rubocop:disable Lint/MissingSuper



6
7
8
9
10
11
12
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 6

def initialize(model, guidance = nil) # rubocop:disable Lint/MissingSuper
  @model = model
  @guidance = guidance
  @children_packages ||= packages.map do |pkg|
    [pkg, pkg.packages, pkg.packages.map(&:children_packages)]
  end.flatten.uniq
end

Instance Method Details

#children_packagesObject



53
54
55
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 53

def children_packages
  @children_packages
end

#data_typesObject



35
36
37
38
39
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 35

def data_types
  @model[:data_types].map do |data_type|
    ::Lutaml::XMI::DataTypeDrop.new(data_type)
  end
end

#definitionObject



57
58
59
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 57

def definition
  @model[:definition]
end

#diagramsObject



41
42
43
44
45
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 41

def diagrams
  @model[:diagrams].map do |diagram|
    ::Lutaml::XMI::DiagramDrop.new(diagram)
  end
end

#enumsObject



29
30
31
32
33
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 29

def enums
  @model[:enums].map do |enum|
    ::Lutaml::XMI::EnumDrop.new(enum)
  end
end

#klassesObject Also known as: classes



22
23
24
25
26
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 22

def klasses
  @model[:classes].map do |klass|
    ::Lutaml::XMI::KlassDrop.new(klass, @guidance)
  end
end

#nameObject



18
19
20
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 18

def name
  @model[:name]
end

#packagesObject



47
48
49
50
51
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 47

def packages
  @model[:packages].map do |package|
    ::Lutaml::XMI::PackageDrop.new(package, @guidance)
  end
end

#stereotypeObject



61
62
63
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 61

def stereotype
  @model[:stereotype]
end

#xmi_idObject



14
15
16
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 14

def xmi_id
  @model[:xmi_id]
end