Class: Lutaml::XMI::GeneralizationAttributeDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Lutaml::XMI::GeneralizationAttributeDrop
- Defined in:
- lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb
Instance Method Summary collapse
- #association ⇒ Object
- #cardinality ⇒ Object
- #definition ⇒ Object
- #gen_name ⇒ Object
- #guidance ⇒ Object
- #has_association? ⇒ Boolean
- #id ⇒ Object
-
#initialize(attr, upper_klass, gen_name, guidance = nil) ⇒ GeneralizationAttributeDrop
constructor
rubocop:disable Lint/MissingSuper.
- #is_derived ⇒ Object
- #name ⇒ Object
- #name_ns ⇒ Object
- #type ⇒ Object
- #type_ns ⇒ Object
- #upper_klass ⇒ Object
- #used? ⇒ Boolean
- #xmi_id ⇒ Object
Constructor Details
#initialize(attr, upper_klass, gen_name, guidance = nil) ⇒ GeneralizationAttributeDrop
rubocop:disable Lint/MissingSuper
6 7 8 9 10 11 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 6 def initialize(attr, upper_klass, gen_name, guidance = nil) # rubocop:disable Lint/MissingSuper @attr = attr @upper_klass = upper_klass @gen_name = gen_name @guidance = guidance end |
Instance Method Details
#association ⇒ Object
41 42 43 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 41 def association @attr[:association] end |
#cardinality ⇒ Object
33 34 35 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 33 def cardinality ::Lutaml::XMI::CardinalityDrop.new(@attr[:cardinality]) end |
#definition ⇒ Object
37 38 39 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 37 def definition @attr[:definition] end |
#gen_name ⇒ Object
57 58 59 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 57 def gen_name @gen_name end |
#guidance ⇒ Object
83 84 85 86 87 88 89 90 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 83 def guidance if @guidance col_name = "#{name_ns}:#{name}" attr = @guidance["attributes"].find { |a| a["name"] == col_name } attr["guidance"] if attr end end |
#has_association? ⇒ Boolean
45 46 47 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 45 def has_association? !!@attr[:association] end |
#id ⇒ Object
13 14 15 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 13 def id @attr[:id] end |
#is_derived ⇒ Object
29 30 31 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 29 def is_derived @attr[:is_derived] end |
#name ⇒ Object
17 18 19 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 17 def name @attr[:name] end |
#name_ns ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 61 def name_ns name_ns = case @attr[:type_ns] when "core", "gml" upper_klass else @attr[:type_ns] end name_ns = upper_klass if name_ns.nil? name_ns end |
#type ⇒ Object
21 22 23 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 21 def type @attr[:type] end |
#type_ns ⇒ Object
49 50 51 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 49 def type_ns @attr[:type_ns] end |
#upper_klass ⇒ Object
53 54 55 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 53 def upper_klass @upper_klass end |
#used? ⇒ Boolean
73 74 75 76 77 78 79 80 81 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 73 def used? if @guidance col_name = "#{name_ns}:#{name}" attr = @guidance["attributes"].find { |a| a["name"] == col_name } return attr["used"] if attr end true end |
#xmi_id ⇒ Object
25 26 27 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 25 def xmi_id @attr[:xmi_id] end |