Class: Lutaml::Uml::Association
- Inherits:
-
TopElement
- Object
- TopElement
- Lutaml::Uml::Association
- Includes:
- HasMembers
- Defined in:
- lib/lutaml/uml/association.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#member_end ⇒ Object
Returns the value of attribute member_end.
-
#member_end_attribute_name ⇒ Object
Returns the value of attribute member_end_attribute_name.
-
#member_end_cardinality ⇒ Object
Returns the value of attribute member_end_cardinality.
-
#member_end_type ⇒ Object
Returns the value of attribute member_end_type.
-
#member_end_xmi_id ⇒ Object
Returns the value of attribute member_end_xmi_id.
-
#owner_end ⇒ Object
Returns the value of attribute owner_end.
-
#owner_end_attribute_name ⇒ Object
Returns the value of attribute owner_end_attribute_name.
-
#owner_end_cardinality ⇒ Object
Returns the value of attribute owner_end_cardinality.
-
#owner_end_type ⇒ Object
Returns the value of attribute owner_end_type.
-
#owner_end_xmi_id ⇒ Object
Returns the value of attribute owner_end_xmi_id.
-
#static ⇒ Object
Returns the value of attribute static.
Attributes inherited from TopElement
#comments, #definition, #href, #keyword, #name, #namespace, #stereotype, #visibility, #xmi_id, #xmi_uuid
Instance Method Summary collapse
-
#members=(value) ⇒ Object
TODO: move to Parslet::Transform.
Methods inherited from TopElement
Methods included from HasAttributes
Constructor Details
This class inherits a constructor from Lutaml::Uml::TopElement
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
8 9 10 |
# File 'lib/lutaml/uml/association.rb', line 8 def action @action end |
#member_end ⇒ Object
Returns the value of attribute member_end.
8 9 10 |
# File 'lib/lutaml/uml/association.rb', line 8 def member_end @member_end end |
#member_end_attribute_name ⇒ Object
Returns the value of attribute member_end_attribute_name.
8 9 10 |
# File 'lib/lutaml/uml/association.rb', line 8 def member_end_attribute_name @member_end_attribute_name end |
#member_end_cardinality ⇒ Object
Returns the value of attribute member_end_cardinality.
8 9 10 |
# File 'lib/lutaml/uml/association.rb', line 8 def member_end_cardinality @member_end_cardinality end |
#member_end_type ⇒ Object
Returns the value of attribute member_end_type.
8 9 10 |
# File 'lib/lutaml/uml/association.rb', line 8 def member_end_type @member_end_type end |
#member_end_xmi_id ⇒ Object
Returns the value of attribute member_end_xmi_id.
8 9 10 |
# File 'lib/lutaml/uml/association.rb', line 8 def member_end_xmi_id @member_end_xmi_id end |
#owner_end ⇒ Object
Returns the value of attribute owner_end.
8 9 10 |
# File 'lib/lutaml/uml/association.rb', line 8 def owner_end @owner_end end |
#owner_end_attribute_name ⇒ Object
Returns the value of attribute owner_end_attribute_name.
8 9 10 |
# File 'lib/lutaml/uml/association.rb', line 8 def owner_end_attribute_name @owner_end_attribute_name end |
#owner_end_cardinality ⇒ Object
Returns the value of attribute owner_end_cardinality.
8 9 10 |
# File 'lib/lutaml/uml/association.rb', line 8 def owner_end_cardinality @owner_end_cardinality end |
#owner_end_type ⇒ Object
Returns the value of attribute owner_end_type.
8 9 10 |
# File 'lib/lutaml/uml/association.rb', line 8 def owner_end_type @owner_end_type end |
#owner_end_xmi_id ⇒ Object
Returns the value of attribute owner_end_xmi_id.
8 9 10 |
# File 'lib/lutaml/uml/association.rb', line 8 def owner_end_xmi_id @owner_end_xmi_id end |
#static ⇒ Object
Returns the value of attribute static.
8 9 10 |
# File 'lib/lutaml/uml/association.rb', line 8 def static @static end |
Instance Method Details
#members=(value) ⇒ Object
TODO: move to Parslet::Transform
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/lutaml/uml/association.rb', line 22 def members=(value) value.group_by { |member| member.keys.first } .each do |(type, group)| if %w[owner_end member_end].include?(type) group.each do |member| member.each_pair do |key, member_value| public_send(:"#{associtaion_type(key)}=", member_value) end end next end attribute_value = group.map(&:values).flatten if attribute_value.length == 1 && !attribute_value.first.is_a?(Hash) next public_send(:"#{associtaion_type(type)}=", attribute_value.first) end public_send(:"#{associtaion_type(type)}=", attribute_value) end end |