class Bonito::Moment

A Moment represents a single instant in time in which events may occur. Scheduler classes may be used in order to yield a sequence of Moment objects, each of which has been decorated with a Scope object, within the context of which the events defined in the Moment will be evaluated, as well as an Integer offset representing a number of seconds from some arbitrary start point.

Such a Scheduler object may be passed to a Runner, along with some fixed starting point. The runner can the be used to evaluate the events defined in each of the scheduled Moment objects, simulating the time at which they occur to be that of the starting point plus the offset.

Public Class Methods

new(&block) click to toggle source

Initialises a new Moment

block

A Proc that will be evaluated at some simulated point in time by a Runner

Calls superclass method
# File lib/bonito/moment.rb, line 30
def initialize(&block)
  @block = block
  super 0
end