Class: Lutaml::Xmi::LiquidDrops::EnumDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Lutaml::Xmi::LiquidDrops::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
- #subtype_of ⇒ 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
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/lutaml/xmi/liquid_drops/enum_drop.rb', line 9 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
35 36 37 |
# File 'lib/lutaml/xmi/liquid_drops/enum_drop.rb', line 35 def definition doc_node_attribute_value(@model.id, "documentation") end |
#name ⇒ Object
24 25 26 |
# File 'lib/lutaml/xmi/liquid_drops/enum_drop.rb', line 24 def name @model.name end |
#stereotype ⇒ Object
39 40 41 |
# File 'lib/lutaml/xmi/liquid_drops/enum_drop.rb', line 39 def stereotype doc_node_attribute_value(@model.id, "stereotype") end |
#subtype_of ⇒ Object
51 52 53 |
# File 'lib/lutaml/xmi/liquid_drops/enum_drop.rb', line 51 def subtype_of find_subtype_of_from_owned_attribute_type(@model.id) end |
#upper_packaged_element ⇒ Object
Returns name of the upper packaged element.
44 45 46 47 48 49 |
# File 'lib/lutaml/xmi/liquid_drops/enum_drop.rb', line 44 def upper_packaged_element if @options[:with_gen] e = find_upper_level_packaged_element(@model.id) e&.name end end |
#values ⇒ Object
28 29 30 31 32 33 |
# File 'lib/lutaml/xmi/liquid_drops/enum_drop.rb', line 28 def values @owned_literals.map do |owned_literal| ::Lutaml::Xmi::LiquidDrops::EnumOwnedLiteralDrop.new(owned_literal, @options) end end |
#xmi_id ⇒ Object
20 21 22 |
# File 'lib/lutaml/xmi/liquid_drops/enum_drop.rb', line 20 def xmi_id @model.id end |