Class: Lutaml::XMI::GeneralizationAttributeDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Lutaml::XMI::GeneralizationAttributeDrop
- Includes:
- Parsers::XMIBase
- 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,Metrics/ParameterLists,Layout/LineLength.
-
#is_derived ⇒ Object
rubocop:disable Naming/PredicateName.
- #name ⇒ Object
- #name_ns ⇒ Object
- #type ⇒ Object
- #type_ns ⇒ Object
- #upper_klass ⇒ Object
- #used? ⇒ Boolean
- #xmi_id ⇒ Object
Methods included from Parsers::XMIBase
Constructor Details
#initialize(attr, upper_klass, gen_name, guidance = nil) ⇒ GeneralizationAttributeDrop
rubocop:disable Lint/MissingSuper,Metrics/ParameterLists,Layout/LineLength
8 9 10 11 12 13 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 8 def initialize(attr, upper_klass, gen_name, guidance = nil) # rubocop:disable Lint/MissingSuper,Metrics/ParameterLists,Layout/LineLength @attr = attr @upper_klass = upper_klass @gen_name = gen_name @guidance = guidance end |
Instance Method Details
#association ⇒ Object
43 44 45 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 43 def association @attr[:association] end |
#cardinality ⇒ Object
35 36 37 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 35 def cardinality ::Lutaml::XMI::CardinalityDrop.new(@attr[:cardinality]) end |
#definition ⇒ Object
39 40 41 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 39 def definition @attr[:definition] end |
#gen_name ⇒ Object
59 60 61 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 59 def gen_name @gen_name end |
#guidance ⇒ Object
77 78 79 80 81 82 83 84 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 77 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
47 48 49 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 47 def has_association? !!@attr[:association] end |
#id ⇒ Object
15 16 17 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 15 def id @attr[:id] end |
#is_derived ⇒ Object
rubocop:disable Naming/PredicateName
31 32 33 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 31 def is_derived # rubocop:disable Naming/PredicateName @attr[:is_derived] end |
#name ⇒ Object
19 20 21 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 19 def name @attr[:name] end |
#name_ns ⇒ Object
63 64 65 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 63 def name_ns @attr[:name_ns] end |
#type ⇒ Object
23 24 25 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 23 def type @attr[:type] end |
#type_ns ⇒ Object
51 52 53 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 51 def type_ns @attr[:type_ns] end |
#upper_klass ⇒ Object
55 56 57 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 55 def upper_klass @upper_klass end |
#used? ⇒ Boolean
67 68 69 70 71 72 73 74 75 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 67 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
27 28 29 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 27 def xmi_id @attr[:xmi_id] end |