Class: Wires::TimeScheduler

Inherits:
Object
  • Object
show all
Defined in:
lib/wires/time.rb

Overview

A singleton class to schedule future firing of events

Class Method Summary collapse

Class Method Details

.add(new_item) ⇒ Object Also known as: <<

Add an event to the schedule



91
92
93
94
95
# File 'lib/wires/time.rb', line 91

def add(new_item)
  expect_type new_item, TimeSchedulerItem
  schedule_add(new_item)
  wakeup
nil end

.clearObject

Clear the event schedule from outside the class



102
# File 'lib/wires/time.rb', line 102

def clear; @schedule.clear end

.listObject

Get a copy of the event schedule from outside the class



100
# File 'lib/wires/time.rb', line 100

def list;  @schedule.clone end