Class | Timer::Action
In: | lib/rbot/timer.rb
Parent: | Object

class representing individual timed action

### Methods

block blocked? configure new reschedule run unblock

### Attributes

next | [RW] | Time when the Action should be called next

### Public Class methods

new(options = {}, &block)

Options are:

start: | Time when the Action should be run for the first time. Repeatable Actions will be repeated after that, see :period. One-time Actions will not (obviously) Default: Time.now + :period
period: | How often repeatable Action should be run, in seconds. Default: 1
blocked: | if true, Action starts as blocked (i.e. will stay dormant until unblocked)
args: | Arguments to pass to the Action callback. Default: []
repeat: | Should the Action be called repeatedly? Default: false
code: | You can specify the Action body using &block, or using this option.

### Public Instance methods

block()

blocks an Action, so it won‘t be run

blocked?()
configure(opts = {}, &block)

Provides for on-the-fly reconfiguration of the Actions Accept the same arguments as the constructor

reschedule(period, &block)

modify the Action period

run(now = Time.now)

calls the Action callback, resets .next to the Time of the next call, if the Action is repeatable.

unblock()

unblocks a blocked Action

[Validate]