Class: Lutaml::XMI::DiagramDrop

Inherits:
Liquid::Drop
  • Object
show all
Includes:
Parsers::XMIBase
Defined in:
lib/lutaml/xmi/liquid_drops/diagram_drop.rb

Instance Method Summary collapse

Methods included from Parsers::XMIBase

included, #set_xmi_model

Constructor Details

#initialize(model, options = {}) ⇒ DiagramDrop

rubocop:disable Lint/MissingSuper



8
9
10
11
12
13
# File 'lib/lutaml/xmi/liquid_drops/diagram_drop.rb', line 8

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

Instance Method Details

#definitionObject



23
24
25
# File 'lib/lutaml/xmi/liquid_drops/diagram_drop.rb', line 23

def definition
  @model.properties.documentation
end

#nameObject



19
20
21
# File 'lib/lutaml/xmi/liquid_drops/diagram_drop.rb', line 19

def name
  @model.properties.name
end

#package_idObject



27
28
29
# File 'lib/lutaml/xmi/liquid_drops/diagram_drop.rb', line 27

def package_id
  @model.model.package if @options[:with_gen]
end

#package_nameObject



31
32
33
34
35
# File 'lib/lutaml/xmi/liquid_drops/diagram_drop.rb', line 31

def package_name
  if @options[:with_gen] && package_id
    find_packaged_element_by_id(package_id)&.name
  end
end

#xmi_idObject



15
16
17
# File 'lib/lutaml/xmi/liquid_drops/diagram_drop.rb', line 15

def xmi_id
  @model.id
end