Class: Wheneverd::Schedule
- Inherits:
-
Object
- Object
- Wheneverd::Schedule
- Defined in:
- lib/wheneverd/schedule.rb
Overview
A schedule is an ordered list of Entry objects.
Schedules are typically created by evaluating a schedule file in the DSL context.
Instance Attribute Summary collapse
- #entries ⇒ Array<Entry> readonly
- #services ⇒ Array<Wheneverd::Service> readonly
Instance Method Summary collapse
-
#add_entry(entry) ⇒ Schedule
Append an entry to the schedule.
-
#add_service(service) ⇒ Schedule
Append a long-running service to the schedule.
-
#initialize(entries: [], services: []) ⇒ Schedule
constructor
A new instance of Schedule.
Constructor Details
#initialize(entries: [], services: []) ⇒ Schedule
Returns a new instance of Schedule.
16 17 18 19 |
# File 'lib/wheneverd/schedule.rb', line 16 def initialize(entries: [], services: []) @entries = entries.dup @services = services.dup end |
Instance Attribute Details
#entries ⇒ Array<Entry> (readonly)
9 10 11 |
# File 'lib/wheneverd/schedule.rb', line 9 def entries @entries end |
#services ⇒ Array<Wheneverd::Service> (readonly)
12 13 14 |
# File 'lib/wheneverd/schedule.rb', line 12 def services @services end |
Instance Method Details
#add_entry(entry) ⇒ Schedule
Append an entry to the schedule.
25 26 27 28 |
# File 'lib/wheneverd/schedule.rb', line 25 def add_entry(entry) entries << entry self end |
#add_service(service) ⇒ Schedule
Append a long-running service to the schedule.
34 35 36 37 |
# File 'lib/wheneverd/schedule.rb', line 34 def add_service(service) services << service self end |