Class: Lutaml::XMI::AttributeDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Lutaml::XMI::AttributeDrop
show all
- Includes:
- Parsers::XMIBase
- Defined in:
- lib/lutaml/xmi/liquid_drops/attribute_drop.rb
Instance Method Summary
collapse
#get_guidance, included, #set_xmi_model
Constructor Details
#initialize(model, options = {}) ⇒ AttributeDrop
rubocop:disable Lint/MissingSuper
8
9
10
11
12
13
14
15
16
|
# File 'lib/lutaml/xmi/liquid_drops/attribute_drop.rb', line 8
def initialize(model, options = {}) @model = model
@options = options
@xmi_root_model = options[:xmi_root_model]
@xmi_cache = options[:xmi_cache]
uml_type = @model.uml_type
@uml_type_idref = uml_type.idref if uml_type
end
|
Instance Method Details
#association ⇒ Object
52
53
54
55
56
|
# File 'lib/lutaml/xmi/liquid_drops/attribute_drop.rb', line 52
def association
if @options[:with_assoc] && @model.association
@model.association
end
end
|
#cardinality ⇒ Object
38
39
40
|
# File 'lib/lutaml/xmi/liquid_drops/attribute_drop.rb', line 38
def cardinality
::Lutaml::XMI::CardinalityDrop.new(@model)
end
|
#definition ⇒ Object
42
43
44
45
46
47
48
49
50
|
# File 'lib/lutaml/xmi/liquid_drops/attribute_drop.rb', line 42
def definition
definition = lookup_attribute_documentation(@model.id)
if @options[:with_assoc] && @model.association
definition = loopup_assoc_def(@model.association)
end
definition
end
|
#id ⇒ Object
18
19
20
|
# File 'lib/lutaml/xmi/liquid_drops/attribute_drop.rb', line 18
def id
@model.id
end
|
#is_derived ⇒ Object
rubocop:disable Naming/PredicateName
34
35
36
|
# File 'lib/lutaml/xmi/liquid_drops/attribute_drop.rb', line 34
def is_derived @model.is_derived
end
|
#name ⇒ Object
22
23
24
|
# File 'lib/lutaml/xmi/liquid_drops/attribute_drop.rb', line 22
def name
@model.name
end
|
#type ⇒ Object
26
27
28
|
# File 'lib/lutaml/xmi/liquid_drops/attribute_drop.rb', line 26
def type
lookup_entity_name(@uml_type_idref) || @uml_type_idref
end
|
#type_ns ⇒ Object
58
59
60
61
62
|
# File 'lib/lutaml/xmi/liquid_drops/attribute_drop.rb', line 58
def type_ns
if @options[:with_assoc] && @model.association
get_ns_by_xmi_id(xmi_id)
end
end
|
#xmi_id ⇒ Object
30
31
32
|
# File 'lib/lutaml/xmi/liquid_drops/attribute_drop.rb', line 30
def xmi_id
@uml_type_idref
end
|