Class: RRT_RUBY::RRTLogical::Capsule

Inherits:
RRT_RUBY::RRTGeneric::Element show all
Defined in:
lib/rrt_ruby/rrt_logical.rb

Instance Attribute Summary collapse

Attributes inherited from RRT_RUBY::RRTGeneric::Element

#documentation, #name, #qualifiedname, #stereotype

Instance Method Summary collapse

Constructor Details

#initialize(element) ⇒ Capsule

Returns a new instance of Capsule.



62
63
64
65
66
67
68
69
70
71
72
# File 'lib/rrt_ruby/rrt_logical.rb', line 62

def initialize element
	begin
		super(element)
		#get the roles out of the element
		@roles=extract_roles(element.Structure.ClassifierRoles)
		@connectors=extract_connectors(element.Structure.Connectors)
		@dependencies=extract_dependencies(element.GetClassDependencies)
	rescue
		raise RRTGeneric::ElementException.new(element),"error while initialising element: #{$!}"
	end
end

Instance Attribute Details

#connectorsObject (readonly)

Returns the value of attribute connectors.



61
62
63
# File 'lib/rrt_ruby/rrt_logical.rb', line 61

def connectors
  @connectors
end

#dependenciesObject (readonly)

Returns the value of attribute dependencies.



61
62
63
# File 'lib/rrt_ruby/rrt_logical.rb', line 61

def dependencies
  @dependencies
end

#rolesObject (readonly)

Returns the value of attribute roles.



61
62
63
# File 'lib/rrt_ruby/rrt_logical.rb', line 61

def roles
  @roles
end

Instance Method Details

#to_sObject



74
75
76
# File 'lib/rrt_ruby/rrt_logical.rb', line 74

def to_s
	return "#{@name}, #{@roles.size} roles, #{@dependencies.size} dependencies"
end