Class: Chingu::AsyncTasks::Exec

Inherits:
Chingu::Async::BasicTask show all
Defined in:
lib/chingu/async_tasks/exec.rb

Overview

Block execution as an asynchronous task.

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Exec

Returns a new instance of Exec



30
31
32
33
34
# File 'lib/chingu/async_tasks/exec.rb', line 30

def initialize(&block)
  super()
  @block = block
  @finished = false
end

Instance Method Details

#finished?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/chingu/async_tasks/exec.rb', line 41

def finished?
  !!@finished
end

#update(object) ⇒ Object



36
37
38
39
# File 'lib/chingu/async_tasks/exec.rb', line 36

def update(object)
  @block[]
  @finished = true
end