Class: ParallelTasker::Task

Inherits:
Object
  • Object
show all
Defined in:
lib/parallel_tasker/task.rb

Overview

Task to be run

Defined Under Namespace

Classes: NoBlockGiven

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, &block) ⇒ Task

Receive a task id, an a block with the task

Raises:



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

#blockObject

Returns the value of attribute block.



5
6
7
# File 'lib/parallel_tasker/task.rb', line 5

def block
  @block
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/parallel_tasker/task.rb', line 5

def id
  @id
end