Class: Lutaml::Xmi::LiquidDrops::RootDrop

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

Instance Method Summary collapse

Constructor Details

#initialize(model, guidance = nil, options = {}) ⇒ RootDrop

rubocop:disable Lint/MissingSuper



7
8
9
10
11
12
13
14
15
# File 'lib/lutaml/xmi/liquid_drops/root_drop.rb', line 7

def initialize(model, guidance = nil, options = {}) # rubocop:disable Lint/MissingSuper
  @model = model
  @guidance = guidance
  @options = options
  @xmi_root_model = options[:xmi_root_model]
  @id_name_mapping = options[:id_name_mapping]

  @options[:absolute_path] = "::#{model.name}"
end

Instance Method Details

#children_packagesObject



28
29
30
# File 'lib/lutaml/xmi/liquid_drops/root_drop.rb', line 28

def children_packages
  @model.packages.flat_map(&:children_packages).uniq
end

#nameObject



17
18
19
# File 'lib/lutaml/xmi/liquid_drops/root_drop.rb', line 17

def name
  @model.name
end

#packagesObject



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

def packages
  @model.packages.map do |package|
    ::Lutaml::Xmi::LiquidDrops::PackageDrop.new(package, @guidance,
                                                @options)
  end
end