Class: DataType
- Inherits:
-
Object
- Object
- DataType
- Defined in:
- lib/xmimodel/data_type.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#xml ⇒ Object
readonly
Returns the value of attribute xml.
Instance Method Summary collapse
-
#initialize(xml, parent) ⇒ DataType
constructor
A new instance of DataType.
- #to_s ⇒ Object
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
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/xmimodel/data_type.rb', line 7 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/xmimodel/data_type.rb', line 8 def name @name end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
5 6 7 |
# File 'lib/xmimodel/data_type.rb', line 5 def parent @parent end |
#xml ⇒ Object (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_s ⇒ Object
18 19 20 |
# File 'lib/xmimodel/data_type.rb', line 18 def to_s "DataType[#{@name}]" end |