Class: RubstApi::BackgroundTasks

Inherits:
Object
  • Object
show all
Defined in:
lib/rubst_api/background_tasks.rb

Instance Method Summary collapse

Constructor Details

#initializeBackgroundTasks

Returns a new instance of BackgroundTasks.



12
# File 'lib/rubst_api/background_tasks.rb', line 12

def initialize = @tasks = []

Instance Method Details

#add_task(callable = nil, *args, **kwargs, &block) ⇒ Object



13
14
15
# File 'lib/rubst_api/background_tasks.rb', line 13

def add_task(callable = nil, *args, **kwargs, &block)
  @tasks << BackgroundTask.new(callable, *args, **kwargs, &block)
end

#callObject



16
# File 'lib/rubst_api/background_tasks.rb', line 16

def call = @tasks.each(&:call)