Class: Lutaml::XMI::EnumDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Lutaml::XMI::EnumDrop
- Includes:
- Parsers::XMIBase
- Defined in:
- lib/lutaml/xmi/liquid_drops/enum_drop.rb
Instance Method Summary collapse
- #definition ⇒ Object
-
#initialize(model, options = {}) ⇒ EnumDrop
constructor
rubocop:disable Lint/MissingSuper.
- #name ⇒ Object
- #stereotype ⇒ Object
-
#upper_packaged_element ⇒ Object
Name of the upper packaged element.
- #values ⇒ Object
- #xmi_id ⇒ Object
Methods included from Parsers::XMIBase
Constructor Details
#initialize(model, options = {}) ⇒ EnumDrop
rubocop:disable Lint/MissingSuper
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/lutaml/xmi/liquid_drops/enum_drop.rb', line 8 def initialize(model, = {}) # rubocop:disable Lint/MissingSuper @model = model @options = @xmi_root_model = [:xmi_root_model] @id_name_mapping = [:id_name_mapping] @owned_literals = model&.owned_literal&.select do |owned_literal| owned_literal.type? "uml:EnumerationLiteral" end end |
Instance Method Details
#definition ⇒ Object
33 34 35 |
# File 'lib/lutaml/xmi/liquid_drops/enum_drop.rb', line 33 def definition doc_node_attribute_value(@model.id, "documentation") end |
#name ⇒ Object
23 24 25 |
# File 'lib/lutaml/xmi/liquid_drops/enum_drop.rb', line 23 def name @model.name end |
#stereotype ⇒ Object
37 38 39 |
# File 'lib/lutaml/xmi/liquid_drops/enum_drop.rb', line 37 def stereotype doc_node_attribute_value(@model.id, "stereotype") end |
#upper_packaged_element ⇒ Object
Returns name of the upper packaged element.
42 43 44 45 46 |
# File 'lib/lutaml/xmi/liquid_drops/enum_drop.rb', line 42 def upper_packaged_element if @options[:with_gen] find_upper_level_packaged_element(@model.id) end end |
#values ⇒ Object
27 28 29 30 31 |
# File 'lib/lutaml/xmi/liquid_drops/enum_drop.rb', line 27 def values @owned_literals.map do |owned_literal| ::Lutaml::XMI::EnumOwnedLiteralDrop.new(owned_literal, @options) end end |
#xmi_id ⇒ Object
19 20 21 |
# File 'lib/lutaml/xmi/liquid_drops/enum_drop.rb', line 19 def xmi_id @model.id end |