Class: FloorManager

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

Defined Under Namespace

Modules: Employee Classes: Floor

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.floorsObject (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, options={}, &block)
  @floors ||= {}
  
  @floors[environment_name] = FloorManager::Floor.from_dsl(options, &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

.resetObject

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