Class: CaDOVe::XMI::UMLAttribute

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/cadove/models/XMI/document.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#remove_package_name

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

#keyObject



116
117
118
# File 'lib/cadove/models/XMI/document.rb', line 116

def key
  "#{name} (#{type})"
end

#nameObject



108
109
110
# File 'lib/cadove/models/XMI/document.rb', line 108

def name
  @name ||= @xml.attributes['name']
end

#typeObject



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