Class: Construqt::Racks

Inherits:
Object
  • Object
show all
Defined in:
lib/construqt/rack.rb

Defined Under Namespace

Classes: Rack

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(region) ⇒ Racks

Returns a new instance of Racks.



8
9
10
11
# File 'lib/construqt/rack.rb', line 8

def initialize(region)
  @region = region
  @racks = {}
end

Instance Attribute Details

#racksObject (readonly)

Returns the value of attribute racks.



7
8
9
# File 'lib/construqt/rack.rb', line 7

def racks
  @racks
end

#regionObject (readonly)

Returns the value of attribute region.



7
8
9
# File 'lib/construqt/rack.rb', line 7

def region
  @region
end

Instance Method Details

#add_rack(name) ⇒ Object



36
37
38
39
40
41
# File 'lib/construqt/rack.rb', line 36

def add_rack(name)
  throw "Rack with name exist #{name}" if @racks[name]
  rack = Rack.new(name)
  @racks[name] = rack
  rack
end

#find_rack(name) ⇒ Object



43
44
45
46
# File 'lib/construqt/rack.rb', line 43

def find_rack(name)
  throw "Rack with name does not exist #{name}" unless @racks[name]
  @racks[name]
end