Class: RRT_RUBY::RRTDeployment::Processor

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

Instance Attribute Summary collapse

Attributes inherited from RRT_RUBY::RRTGeneric::Element

#documentation, #name, #qualifiedname, #stereotype

Instance Method Summary collapse

Constructor Details

#initialize(element) ⇒ Processor

Returns a new instance of Processor.



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rrt_ruby/rrt_deployment.rb', line 13

def initialize element
  begin
    super(element)
    @cpu=element.CPU
    @os=element.OS
    @address=element.Address
    @server=element.ServerAddress
    @processes=Array.new
    extract_processes(element)
  rescue
    raise RRTGeneric::ElementException.new(element),"error while initialising element: #{$!}"
  end
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



12
13
14
# File 'lib/rrt_ruby/rrt_deployment.rb', line 12

def address
  @address
end

#cpuObject (readonly)

Returns the value of attribute cpu.



12
13
14
# File 'lib/rrt_ruby/rrt_deployment.rb', line 12

def cpu
  @cpu
end

#osObject (readonly)

Returns the value of attribute os.



12
13
14
# File 'lib/rrt_ruby/rrt_deployment.rb', line 12

def os
  @os
end

#processesObject (readonly)

Returns the value of attribute processes.



12
13
14
# File 'lib/rrt_ruby/rrt_deployment.rb', line 12

def processes
  @processes
end

#serverObject (readonly)

Returns the value of attribute server.



12
13
14
# File 'lib/rrt_ruby/rrt_deployment.rb', line 12

def server
  @server
end

Instance Method Details

#to_sObject



26
27
28
# File 'lib/rrt_ruby/rrt_deployment.rb', line 26

def to_s
  return super()+", #{@os}/#{@cpu}, #{@address}, #{@processes.size} processes"
end