Class: Tag
- Inherits:
-
Object
show all
- Defined in:
- lib/xmimodel/tag.rb
Direct Known Subclasses
ActivityGraph, Association, AssociationEnd, Attribute, Clazz, DataType, Generalization, Namespace, Operation, Package, Parameter, SignalEvent, State, Stereotype, TaggedValue, Transition, UseCase
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(xml, parent_tag) ⇒ Tag
19
20
21
22
23
24
25
26
27
|
# File 'lib/xmimodel/tag.rb', line 19
def initialize(xml, parent_tag)
raise "Diferente de Tag. #{parent_tag.class}" if !parent_tag.kind_of?(Tag) && parent_tag.class != XmiModel
@xml = xml
@parent_tag = parent_tag
@id = xml.attribute("xmi.id").to_s
end
|
Instance Attribute Details
#id ⇒ String
12
13
14
|
# File 'lib/xmimodel/tag.rb', line 12
def id
@id
end
|
#parent_tag ⇒ Tag
9
10
11
|
# File 'lib/xmimodel/tag.rb', line 9
def parent_tag
@parent_tag
end
|
#xml ⇒ Nokogiri::XML::Element
6
7
8
|
# File 'lib/xmimodel/tag.rb', line 6
def xml
@xml
end
|
Instance Method Details
#xml_root ⇒ Object
29
30
31
32
33
34
35
|
# File 'lib/xmimodel/tag.rb', line 29
def xml_root
parent_tag = @parent_tag
until parent_tag.class == XmiModel
parent_tag = parent_tag.parent_tag
end
parent_tag
end
|