Class: FloorManager
- Inherits:
-
Object
- Object
- FloorManager
- Defined in:
- lib/floor_manager.rb
Defined Under Namespace
Modules: Employee Classes: Floor
Class Attribute Summary collapse
-
.floors ⇒ Object
readonly
Returns the value of attribute floors.
Class Method Summary collapse
-
.define(environment_name, options = {}, &block) ⇒ Object
Defines a new environment under the supervision of the floor manager.
-
.get(environment_name) ⇒ Object
Returns an instance of the environment.
-
.reset ⇒ Object
Resets all instances produced.
Class Attribute Details
.floors ⇒ Object (readonly)
Returns the value of attribute floors.
4 5 6 |
# File 'lib/floor_manager.rb', line 4 def floors @floors end |
Class Method Details
.define(environment_name, options = {}, &block) ⇒ Object
Defines a new environment under the supervision of the floor manager.
8 9 10 11 12 |
# File 'lib/floor_manager.rb', line 8 def define(environment_name, ={}, &block) @floors ||= {} @floors[environment_name] = FloorManager::Floor.from_dsl(, &block) end |
.get(environment_name) ⇒ Object
Returns an instance of the environment.
16 17 18 |
# File 'lib/floor_manager.rb', line 16 def get(environment_name) floors[environment_name] end |
.reset ⇒ Object
Resets all instances produced. Use this in after(:each).
22 23 24 25 26 |
# File 'lib/floor_manager.rb', line 22 def reset @floors.values.each do |floor| floor.reset end end |