Class: Construqt::Racks
- Inherits:
-
Object
- Object
- Construqt::Racks
- Defined in:
- lib/construqt/rack.rb
Defined Under Namespace
Classes: Rack
Instance Attribute Summary collapse
-
#racks ⇒ Object
readonly
Returns the value of attribute racks.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
Instance Method Summary collapse
- #add_rack(name) ⇒ Object
- #find_rack(name) ⇒ Object
-
#initialize(region) ⇒ Racks
constructor
A new instance of Racks.
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
#racks ⇒ Object (readonly)
Returns the value of attribute racks.
7 8 9 |
# File 'lib/construqt/rack.rb', line 7 def racks @racks end |
#region ⇒ Object (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 |