Class: Lutaml::Xmi::LiquidDrops::PackageDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Lutaml::Xmi::LiquidDrops::PackageDrop
- Defined in:
- lib/lutaml/xmi/liquid_drops/package_drop.rb
Instance Method Summary collapse
- #absolute_path ⇒ Object
- #children_packages ⇒ Object
- #data_types ⇒ Object
- #definition ⇒ Object
- #diagrams ⇒ Object
- #enums ⇒ Object
-
#initialize(model, guidance = nil, options = {}) ⇒ PackageDrop
constructor
rubocop:disable Lint/MissingSuper.
- #klasses ⇒ Object (also: #classes)
- #name ⇒ Object
- #packages ⇒ Object
- #stereotype ⇒ Object
- #xmi_id ⇒ Object
Constructor Details
#initialize(model, guidance = nil, options = {}) ⇒ PackageDrop
rubocop:disable Lint/MissingSuper
7 8 9 10 11 12 13 |
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 7 def initialize(model, guidance = nil, = {}) # rubocop:disable Lint/MissingSuper @model = model @guidance = guidance @options = @lookup = [:lookup] @xmi_root_model = [:xmi_root_model] end |
Instance Method Details
#absolute_path ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 23 def absolute_path absolute_path_arr = [@model.name] e = @lookup.find_upper_level_packaged_element(@model.xmi_id) absolute_path_arr << e.name if e while e e = @lookup.find_upper_level_packaged_element(e.id) absolute_path_arr << e.name if e end absolute_path_arr << "::#{@xmi_root_model.model.name}" absolute_path_arr.reverse.join("::") end |
#children_packages ⇒ Object
84 85 86 |
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 84 def children_packages @model.children_packages end |
#data_types ⇒ Object
58 59 60 61 62 |
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 58 def data_types @model.data_types.map do |data_type| ::Lutaml::Xmi::LiquidDrops::DataTypeDrop.new(data_type, @options) end end |
#definition ⇒ Object
88 89 90 |
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 88 def definition @model.definition end |
#diagrams ⇒ Object
64 65 66 67 68 |
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 64 def diagrams @model.diagrams.map do |diagram| ::Lutaml::Xmi::LiquidDrops::DiagramDrop.new(diagram, @options) end end |
#enums ⇒ Object
52 53 54 55 56 |
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 52 def enums @model.enums.map do |enum| ::Lutaml::Xmi::LiquidDrops::EnumDrop.new(enum, @options) end end |
#klasses ⇒ Object Also known as: classes
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 37 def klasses @model.classes.map do |klass| ::Lutaml::Xmi::LiquidDrops::KlassDrop.new( klass, @guidance, @options.merge( { absolute_path: "#{@options[:absolute_path]}::#{name}", }, ), ) end end |
#name ⇒ Object
19 20 21 |
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 19 def name @model.name end |
#packages ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 70 def packages @model.packages.map do |package| ::Lutaml::Xmi::LiquidDrops::PackageDrop.new( package, @guidance, @options.merge( { absolute_path: "#{@options[:absolute_path]}::#{name}", }, ), ) end end |
#stereotype ⇒ Object
92 93 94 |
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 92 def stereotype @model.stereotype&.first end |
#xmi_id ⇒ Object
15 16 17 |
# File 'lib/lutaml/xmi/liquid_drops/package_drop.rb', line 15 def xmi_id @model.xmi_id end |