Class: Wires::TimeScheduler
- Inherits:
-
Object
- Object
- Wires::TimeScheduler
- Defined in:
- lib/wires/time.rb
Overview
A singleton class to schedule future firing of events
Class Method Summary collapse
-
.add(new_item) ⇒ Object
(also: <<)
Add an event to the schedule.
-
.clear ⇒ Object
Clear the event schedule from outside the class.
-
.list ⇒ Object
Get a copy of the event schedule from outside the class.
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 |
.clear ⇒ Object
Clear the event schedule from outside the class
102 |
# File 'lib/wires/time.rb', line 102 def clear; @schedule.clear end |
.list ⇒ Object
Get a copy of the event schedule from outside the class
100 |
# File 'lib/wires/time.rb', line 100 def list; @schedule.clone end |