Class: Lutaml::XMI::CardinalityDrop

Inherits:
Liquid::Drop
  • Object
show all
Includes:
Parsers::XMIBase
Defined in:
lib/lutaml/xmi/liquid_drops/cardinality_drop.rb

Instance Method Summary collapse

Methods included from Parsers::XMIBase

included, #set_xmi_model

Constructor Details

#initialize(model) ⇒ CardinalityDrop

rubocop:disable Lint/MissingSuper



8
9
10
# File 'lib/lutaml/xmi/liquid_drops/cardinality_drop.rb', line 8

def initialize(model) # rubocop:disable Lint/MissingSuper
  @model = model
end

Instance Method Details

#maxObject



18
19
20
21
22
# File 'lib/lutaml/xmi/liquid_drops/cardinality_drop.rb', line 18

def max
  return @model[:max] if @model.is_a?(Hash)

  @model.upper_value&.value
end

#minObject



12
13
14
15
16
# File 'lib/lutaml/xmi/liquid_drops/cardinality_drop.rb', line 12

def min
  return @model[:min] if @model.is_a?(Hash)

  @model.lower_value&.value
end