Class: Chingu::AsyncTasks::Call

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

Overview

Single method call as an asynchronous task.

Instance Method Summary collapse

Constructor Details

#initialize(method, *args) ⇒ Call



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

def initialize(method, *args)
  super()
  @method, @args = method, args
  @finished = false
end

Instance Method Details

#finished?Boolean



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

def finished?
  !!@finished
end

#update(object) ⇒ Object



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

def update(object)
  object.send(@method, *@args)
  @finished = true
end