Class: CaDOVe::XMI::UMLAttribute
- Inherits:
-
Object
- Object
- CaDOVe::XMI::UMLAttribute
- Includes:
- Helpers
- Defined in:
- lib/cadove/models/XMI/document.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(xml) ⇒ UMLAttribute
constructor
A new instance of UMLAttribute.
- #key ⇒ Object
- #name ⇒ Object
- #type ⇒ Object
Methods included from Helpers
Constructor Details
#initialize(xml) ⇒ UMLAttribute
Returns a new instance of UMLAttribute.
98 99 100 |
# File 'lib/cadove/models/XMI/document.rb', line 98 def initialize(xml) @xml = xml end |
Class Method Details
.all(class_element) ⇒ Object
102 103 104 105 106 |
# File 'lib/cadove/models/XMI/document.rb', line 102 def self.all(class_element) class_element.elements.collect('.//UML:Attribute') do |a| new(a) end end |
Instance Method Details
#key ⇒ Object
116 117 118 |
# File 'lib/cadove/models/XMI/document.rb', line 116 def key "#{name} (#{type})" end |
#name ⇒ Object
108 109 110 |
# File 'lib/cadove/models/XMI/document.rb', line 108 def name @name ||= @xml.attributes['name'] end |
#type ⇒ Object
112 113 114 |
# File 'lib/cadove/models/XMI/document.rb', line 112 def type @type ||= remove_package_name(REXML::XPath.first(@xml, ".//UML:TaggedValue[@tag='type']").attributes['value']) end |