Class: Roqua::Scheduling::Task
- Inherits:
-
Object
- Object
- Roqua::Scheduling::Task
- Defined in:
- lib/roqua/scheduling/task.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(name, options, callback) ⇒ Task
constructor
A new instance of Task.
- #next_run_at ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(name, options, callback) ⇒ Task
Returns a new instance of Task.
5 6 7 8 9 |
# File 'lib/roqua/scheduling/task.rb', line 5 def initialize(name, , callback) @name = name @options = @callback = callback end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/roqua/scheduling/task.rb', line 3 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/roqua/scheduling/task.rb', line 3 def @options end |
Instance Method Details
#next_run_at ⇒ Object
11 12 13 |
# File 'lib/roqua/scheduling/task.rb', line 11 def next_run_at [:next_run_at].call end |
#run ⇒ Object
15 16 17 |
# File 'lib/roqua/scheduling/task.rb', line 15 def run @callback.call end |