Class: Association
Instance Attribute Summary collapse
-
#end_a ⇒ Object
readonly
Returns the value of attribute end_a.
-
#end_b ⇒ Object
readonly
Returns the value of attribute end_b.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Tag
Instance Method Summary collapse
- #full_name ⇒ String
-
#initialize(xml, parent) ⇒ Association
constructor
A new instance of Association.
- #to_s ⇒ Object
Methods inherited from Tag
Constructor Details
#initialize(xml, parent) ⇒ Association
Returns a new instance of Association.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/xmimodel/association.rb', line 13 def initialize(xml, parent) super(xml, parent) @name = xml.attribute("name").to_s.strip association_end = xml.xpath('./UML:Association.connection/UML:AssociationEnd') @end_a = AssociationEnd.new(association_end, 0, self) @end_b = AssociationEnd.new(association_end, 1, self) end |
Instance Attribute Details
#end_a ⇒ Object (readonly)
Returns the value of attribute end_a.
10 11 12 |
# File 'lib/xmimodel/association.rb', line 10 def end_a @end_a end |
#end_b ⇒ Object (readonly)
Returns the value of attribute end_b.
11 12 13 |
# File 'lib/xmimodel/association.rb', line 11 def end_b @end_b end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/xmimodel/association.rb', line 8 def name @name end |
Instance Method Details
#full_name ⇒ String
25 26 27 28 29 30 31 |
# File 'lib/xmimodel/association.rb', line 25 def full_name if @name.nil? or @name.empty? "#{@end_a.name}[#{@end_a.participant.full_name}] - #{@end_b.name}[#{@end_b.participant.full_name}]" else "#{@name}(#{@end_a.name}[#{@end_a.participant.full_name}] - #{@end_b.name}[#{@end_b.participant.full_name}])" end end |
#to_s ⇒ Object
33 34 35 |
# File 'lib/xmimodel/association.rb', line 33 def to_s "Association[#{@name}]" end |