Class: Pan_rack
- Inherits:
-
Object
- Object
- Pan_rack
- Defined in:
- rlib/pan_rack.rb
Overview
Container for a rack in the Pan cluster in the TDC
Instance Attribute Summary (collapse)
-
- (Object) hosts
Hosts indexed by U.
-
- (Object) rack_name
Returns the value of attribute rack_name.
Instance Method Summary (collapse)
-
- (Pan_host) [](index)
Accessing directly into the racks @hosts Array.
-
- (Pan_host) []=(index, value)
Assignment to the racks @host Array.
-
- (Pan_rack) initialize(rack_name, pan_host = nil)
constructor
Create a Pan_rack instance.
Constructor Details
- (Pan_rack) initialize(rack_name, pan_host = nil)
Create a Pan_rack instance
10 11 12 13 14 15 16 17 18 |
# File 'rlib/pan_rack.rb', line 10 def initialize(rack_name, pan_host=nil) @rack_name = rack_name @hosts = [] if pan_host.class == Array pan_host.each { |ph| @host << ph } elsif pan_host != nil @hosts << pan_host end end |
Instance Attribute Details
- (Object) hosts
Hosts indexed by U
4 5 6 |
# File 'rlib/pan_rack.rb', line 4 def hosts @hosts end |
- (Object) rack_name
Returns the value of attribute rack_name
3 4 5 |
# File 'rlib/pan_rack.rb', line 3 def rack_name @rack_name end |
Instance Method Details
- (Pan_host) [](index)
Accessing directly into the racks @hosts Array
31 32 33 |
# File 'rlib/pan_rack.rb', line 31 def [](index) @hosts[index] end |
- (Pan_host) []=(index, value)
Assignment to the racks @host Array
24 25 26 |
# File 'rlib/pan_rack.rb', line 24 def []=(index,value) @hosts[index] = value end |