class RuneRb::Engine::Event
Represents a task that is executed in the future, once or periodically.
Attributes
delay[R]
The delay in milliseconds.
running[R]
Whether or not the event is currently running.
Public Class Methods
new(delay)
click to toggle source
Create an event with a specified delay.
# File app/core/engine.rb, line 52 def initialize(delay) @delay = delay @running = true end
Public Instance Methods
execute()
click to toggle source
Called when the event is run.
# File app/core/engine.rb, line 63 def execute raise "Event.execute is abstract" end
stop()
click to toggle source
Stops the event from running in the future.
# File app/core/engine.rb, line 58 def stop @running = false end