Class: Lutaml::Xmi::LiquidDrops::GeneralizationAttributeDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Lutaml::Xmi::LiquidDrops::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,Naming/PredicatePrefix.
- #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
9 10 11 12 13 14 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 9 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
44 45 46 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 44 def association @attr[:association] end |
#cardinality ⇒ Object
36 37 38 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 36 def cardinality ::Lutaml::Xmi::LiquidDrops::CardinalityDrop.new(@attr[:cardinality]) end |
#definition ⇒ Object
40 41 42 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 40 def definition @attr[:definition] end |
#gen_name ⇒ Object
60 61 62 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 60 def gen_name @gen_name end |
#guidance ⇒ Object
78 79 80 81 82 83 84 85 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 78 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
48 49 50 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 48 def has_association? !!@attr[:association] end |
#id ⇒ Object
16 17 18 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 16 def id @attr[:id] end |
#is_derived ⇒ Object
rubocop:disable Naming/PredicateName,Naming/PredicatePrefix
32 33 34 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 32 def is_derived # rubocop:disable Naming/PredicateName,Naming/PredicatePrefix @attr[:is_derived] end |
#name ⇒ Object
20 21 22 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 20 def name @attr[:name] end |
#name_ns ⇒ Object
64 65 66 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 64 def name_ns @attr[:name_ns] end |
#type ⇒ Object
24 25 26 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 24 def type @attr[:type] end |
#type_ns ⇒ Object
52 53 54 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 52 def type_ns @attr[:type_ns] end |
#upper_klass ⇒ Object
56 57 58 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 56 def upper_klass @upper_klass end |
#used? ⇒ Boolean
68 69 70 71 72 73 74 75 76 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 68 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
28 29 30 |
# File 'lib/lutaml/xmi/liquid_drops/generalization_attribute_drop.rb', line 28 def xmi_id @attr[:xmi_id] end |