Class: ParallelTasker::Task
- Inherits:
-
Object
- Object
- ParallelTasker::Task
- Defined in:
- lib/parallel_tasker/task.rb
Overview
Task to be run
Defined Under Namespace
Classes: NoBlockGiven
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#id ⇒ Object
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(id, &block) ⇒ Task
constructor
Receive a task id, an a block with the task.
Constructor Details
#initialize(id, &block) ⇒ Task
Receive a task id, an a block with the task
11 12 13 14 15 |
# File 'lib/parallel_tasker/task.rb', line 11 def initialize id, &block raise NoBlockGiven.new("No block given") unless block @id = id @block = block end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
5 6 7 |
# File 'lib/parallel_tasker/task.rb', line 5 def block @block end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/parallel_tasker/task.rb', line 5 def id @id end |