Class: DataType

Inherits:
Object
  • Object
show all
Defined in:
lib/xmimodel/data_type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml, parent) ⇒ DataType

Returns a new instance of DataType.



10
11
12
13
14
15
16
# File 'lib/xmimodel/data_type.rb', line 10

def initialize(xml, parent)
	@xml = xml
	@parent = parent

	@id = xml.attribute("xmi.id").to_s
	@name = xml.attribute("name").to_s.strip		
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



7
8
9
# File 'lib/xmimodel/data_type.rb', line 7

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/xmimodel/data_type.rb', line 8

def name
  @name
end

#parentObject (readonly)

Returns the value of attribute parent.



5
6
7
# File 'lib/xmimodel/data_type.rb', line 5

def parent
  @parent
end

#xmlObject (readonly)

Returns the value of attribute xml.



4
5
6
# File 'lib/xmimodel/data_type.rb', line 4

def xml
  @xml
end

Instance Method Details

#to_sObject



18
19
20
# File 'lib/xmimodel/data_type.rb', line 18

def to_s
	"DataType[#{@name}]"
end