Class: BuildLights::Lights

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

Constant Summary collapse

GREEN =
1
RED =
2

Instance Method Summary collapse

Constructor Details

#initialize(implementation = BottleRocket) ⇒ Lights

Returns a new instance of Lights.



6
7
8
# File 'lib/lights.rb', line 6

def initialize(implementation = BottleRocket)
  @implementation = implementation
end

Instance Method Details

#failedObject



15
16
17
18
# File 'lib/lights.rb', line 15

def failed
  @implementation.turn_on RED
  @implementation.turn_off GREEN
end

#successObject



10
11
12
13
# File 'lib/lights.rb', line 10

def success
  @implementation.turn_on GREEN
  @implementation.turn_off RED
end