Light bulbs
How to install a lightbulb in Ruby:
no_light = true
if old_lightbulb.installed?
if old_lightbulb.dead?
old_lightbulb.remove
end
end
if no_light && old_lightbulb.removed?
new_lightbulb = KitchenCabinet.find_by_torchlight(:lightbulb)
begin
new_lightbulb.install
rescue BurntFingers
swear :lots
light_switch.flick
retry
end
light_switch.flick
end
And there you have it.