Class: Lutaml::Xmi::LiquidDrops::DataTypeDrop

Inherits:
Liquid::Drop
  • Object
show all
Defined in:
lib/lutaml/xmi/liquid_drops/data_type_drop.rb

Instance Method Summary collapse

Constructor Details

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

rubocop:disable Lint/MissingSuper



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

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

Instance Method Details

#associationsObject



37
38
39
40
41
# File 'lib/lutaml/xmi/liquid_drops/data_type_drop.rb', line 37

def associations
  @model.associations.filter_map do |assoc|
    ::Lutaml::Xmi::LiquidDrops::AssociationDrop.new(assoc, @options)
  end
end

#attributesObject



22
23
24
25
26
27
28
29
# File 'lib/lutaml/xmi/liquid_drops/data_type_drop.rb', line 22

def attributes
  @model.attributes.filter_map do |owned_attr|
    if @options[:with_assoc] || owned_attr.association.nil?
      ::Lutaml::Xmi::LiquidDrops::AttributeDrop.new(owned_attr,
                                                    @options)
    end
  end
end

#constraintsObject



43
44
45
46
47
# File 'lib/lutaml/xmi/liquid_drops/data_type_drop.rb', line 43

def constraints
  @model.constraints.map do |constraint|
    ::Lutaml::Xmi::LiquidDrops::ConstraintDrop.new(constraint)
  end
end

#definitionObject



53
54
55
# File 'lib/lutaml/xmi/liquid_drops/data_type_drop.rb', line 53

def definition
  @model.definition
end

#is_abstractObject

rubocop:disable Naming/PredicateName,Naming/PredicatePrefix



49
50
51
# File 'lib/lutaml/xmi/liquid_drops/data_type_drop.rb', line 49

def is_abstract # rubocop:disable Naming/PredicateName,Naming/PredicatePrefix
  @model.is_abstract
end

#nameObject



18
19
20
# File 'lib/lutaml/xmi/liquid_drops/data_type_drop.rb', line 18

def name
  @model.name
end

#operationsObject



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

def operations
  @model.operations.map do |operation|
    ::Lutaml::Xmi::LiquidDrops::OperationDrop.new(operation)
  end
end

#stereotypeObject



57
58
59
# File 'lib/lutaml/xmi/liquid_drops/data_type_drop.rb', line 57

def stereotype
  @model.stereotype&.first
end

#xmi_idObject



14
15
16
# File 'lib/lutaml/xmi/liquid_drops/data_type_drop.rb', line 14

def xmi_id
  @model.xmi_id
end