Class: Lita::Schedule
- Inherits:
-
Object
- Object
- Lita::Schedule
- Extended by:
- Forwardable
- Defined in:
- lib/lita/schedule.rb,
lib/lita/schedule/version.rb
Defined Under Namespace
Classes: Job
Constant Summary collapse
- VERSION =
"0.0.4"
Instance Attribute Summary collapse
-
#redis ⇒ Object
readonly
Returns the value of attribute redis.
-
#robot ⇒ Object
readonly
Returns the value of attribute robot.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(robot) ⇒ Schedule
constructor
A new instance of Schedule.
Constructor Details
Instance Attribute Details
#redis ⇒ Object (readonly)
Returns the value of attribute redis.
7 8 9 |
# File 'lib/lita/schedule.rb', line 7 def redis @redis end |
#robot ⇒ Object (readonly)
Returns the value of attribute robot.
8 9 10 |
# File 'lib/lita/schedule.rb', line 8 def robot @robot end |
Class Method Details
.cron(field, job_name) ⇒ Object
13 14 15 |
# File 'lib/lita/schedule.rb', line 13 def cron(field, job_name) jobs << Job.new(:cron, field, job_name) end |
.every(field, job_name) ⇒ Object
17 18 19 |
# File 'lib/lita/schedule.rb', line 17 def every(field, job_name) jobs << Job.new(:cycle, field, job_name) end |
.jobs ⇒ Object
21 22 23 |
# File 'lib/lita/schedule.rb', line 21 def jobs @jobs ||= [] end |
.namespace ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/lita/schedule.rb', line 25 def namespace if name Util.underscore(name.split("::").last) else raise "Schedules that are anonymous classes must define self.name." end end |