X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Ftimer.rb;h=db0c6ea16bee0d89aefd0104832347551fee997c;hb=02c79244569748ebc41a8d6548314a802d8375d0;hp=c87c9c4db80aad98b1b123a0f19e028950b8592c;hpb=a9b32eae21a10254f67653c8ce92076300ba670b;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/timer.rb b/lib/rbot/timer.rb index c87c9c4d..db0c6ea1 100644 --- a/lib/rbot/timer.rb +++ b/lib/rbot/timer.rb @@ -117,16 +117,19 @@ module Timer # block action with handle +handle+ def block(handle) + raise "no such timer #{handle}" unless @timers[handle] @timers[handle].blocked = true end # unblock action with handle +handle+ def unblock(handle) + raise "no such timer #{handle}" unless @timers[handle] @timers[handle].blocked = false end # reschedule action with handle +handle+ to change its period def reschedule(handle, period) + raise "no such timer #{handle}" unless @timers[handle] @timers[handle].reschedule(period) end