Class: Lutaml::Xmi::LiquidDrops::GeneralizationAttributeDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Lutaml::Xmi::LiquidDrops::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,Metrics/ParameterLists,Layout/LineLength.
-
#is_derived ⇒ Object
rubocop:disable Naming/PredicateName,Naming/PredicatePrefix.
- #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,Metrics/ParameterLists,Layout/LineLength
7 8 9 10 11 12 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 7 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
42 43 44 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 42 def association @attr.association end |
#cardinality ⇒ Object
34 35 36 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 34 def cardinality ::Lutaml::Xmi::LiquidDrops::CardinalityDrop.new(@attr.cardinality) end |
#definition ⇒ Object
38 39 40 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 38 def definition @attr.definition end |
#gen_name ⇒ Object
58 59 60 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 58 def gen_name @gen_name end |
#guidance ⇒ Object
76 77 78 79 80 81 82 83 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 76 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
46 47 48 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 46 def has_association? !!@attr.association end |
#id ⇒ Object
14 15 16 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 14 def id @attr.id end |
#is_derived ⇒ Object
rubocop:disable Naming/PredicateName,Naming/PredicatePrefix
30 31 32 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 30 def is_derived # rubocop:disable Naming/PredicateName,Naming/PredicatePrefix @attr.is_derived end |
#name ⇒ Object
18 19 20 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 18 def name @attr.name end |
#name_ns ⇒ Object
62 63 64 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 62 def name_ns @attr.name_ns end |
#type ⇒ Object
22 23 24 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 22 def type @attr.type end |
#type_ns ⇒ Object
50 51 52 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 50 def type_ns @attr.type_ns end |
#upper_klass ⇒ Object
54 55 56 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 54 def upper_klass @upper_klass end |
#used? ⇒ Boolean
66 67 68 69 70 71 72 73 74 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 66 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
26 27 28 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 26 def xmi_id @attr.xmi_id end |