Class: Chingu::AsyncTasks::Exec
- Inherits:
-
Chingu::Async::BasicTask
- Object
- Chingu::Async::BasicTask
- Chingu::AsyncTasks::Exec
- Defined in:
- lib/chingu/async_tasks/exec.rb
Overview
Block execution as an asynchronous task.
Instance Method Summary collapse
- #finished? ⇒ Boolean
-
#initialize(&block) ⇒ Exec
constructor
A new instance of Exec.
- #update(object) ⇒ Object
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
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 |