Sha256: 10b9d4860559e3dcb055ccfba80ac2b85b6f9c15ab5364add04901c1bd469237
Contents?: true
Size: 1.78 KB
Versions: 6
Compression:
Stored size: 1.78 KB
Contents
# frozen_string_literal: true module Lutaml module XMI class KlassDrop < Liquid::Drop def initialize(model, guidance = nil) # rubocop:disable Lint/MissingSuper @model = model @guidance = guidance if guidance @klass_guidance = guidance["classes"].find do |klass| klass["name"] == name || klass["name"] == absolute_path end end end def xmi_id @model[:xmi_id] end def name @model[:name] end def absolute_path "#{@model[:absolute_path]}::#{name}" end def package ::Lutaml::XMI::PackageDrop.new(@model[:package], @guidance) end def type @model[:type] end def attributes @model[:attributes]&.map do |attribute| ::Lutaml::XMI::AttributeDrop.new(attribute) end end def associations @model[:associations]&.map do |association| ::Lutaml::XMI::AssociationDrop.new(association) end end def operations @model[:operations]&.map do |operation| ::Lutaml::XMI::OperationDrop.new(operation) end end def constraints @model[:constraints]&.map do |constraint| ::Lutaml::XMI::ConstraintDrop.new(constraint) end end def generalization return {} if @model[:generalization].nil? ::Lutaml::XMI::GeneralizationDrop.new(@model[:generalization], @klass_guidance) end def has_guidance? !!@klass_guidance end def is_abstract @model[:is_abstract] end def definition @model[:definition] end def stereotype @model[:stereotype] end end end end
Version data entries
6 entries across 6 versions & 1 rubygems