Class: Scheduler::ProcTask
- Defined in:
- scripts/00700 Ajout_PSDK/00100 Scheduler.rb
Overview
Description of a Task that execute a Proc
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
Name that describe the task.
-
#priority ⇒ Integer
readonly
Priority of the task.
Instance Method Summary collapse
-
#initialize(name, priority, proc_object) ⇒ ProcTask
constructor
Initialize a ProcTask with its name, priority and the Proc it executes.
-
#start
Invoke the #call method of the proc.
Constructor Details
#initialize(name, priority, proc_object) ⇒ ProcTask
Initialize a ProcTask with its name, priority and the Proc it executes
98 99 100 101 102 |
# File 'scripts/00700 Ajout_PSDK/00100 Scheduler.rb', line 98 def initialize(name, priority, proc_object) @name = name @priority = -priority @proc = proc_object end |
Instance Attribute Details
#name ⇒ String (readonly)
Name that describe the task
93 94 95 |
# File 'scripts/00700 Ajout_PSDK/00100 Scheduler.rb', line 93 def name @name end |
#priority ⇒ Integer (readonly)
Priority of the task
90 91 92 |
# File 'scripts/00700 Ajout_PSDK/00100 Scheduler.rb', line 90 def priority @priority end |
Instance Method Details
#start
Invoke the #call method of the proc
105 106 107 |
# File 'scripts/00700 Ajout_PSDK/00100 Scheduler.rb', line 105 def start @proc.call end |