Class: RRT_RUBY::RRTGeneric::Element

Inherits:
Object
  • Object
show all
Defined in:
lib/rrt_ruby/rrt_generic.rb

Overview

This is the base class for all model elements. It corresponds to RRTEI::ModelElement

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(element) ⇒ Element

element is the OLE Object of a RRTEI::ModelElement or derived class



22
23
24
25
26
27
28
29
30
31
# File 'lib/rrt_ruby/rrt_generic.rb', line 22

def initialize element
	begin
		@name=element.Name
		@qualifiedname=element.GetQualifiedName
		@stereotype=element.Stereotype
		@documentation=element.Documentation
	rescue
		raise ElementException.new(element),"error while initialising element: #{$!}"
	end
end

Instance Attribute Details

#documentationObject (readonly)

Returns the value of attribute documentation.



20
21
22
# File 'lib/rrt_ruby/rrt_generic.rb', line 20

def documentation
  @documentation
end

#nameObject (readonly)

Returns the value of attribute name.



20
21
22
# File 'lib/rrt_ruby/rrt_generic.rb', line 20

def name
  @name
end

#qualifiednameObject (readonly)

Returns the value of attribute qualifiedname.



20
21
22
# File 'lib/rrt_ruby/rrt_generic.rb', line 20

def qualifiedname
  @qualifiedname
end

#stereotypeObject (readonly)

Returns the value of attribute stereotype.



20
21
22
# File 'lib/rrt_ruby/rrt_generic.rb', line 20

def stereotype
  @stereotype
end

Instance Method Details

#to_sObject



33
34
35
# File 'lib/rrt_ruby/rrt_generic.rb', line 33

def to_s
	return "<<#{@stereotype}>>#{@name}"
end