Class: RubstApi::BackgroundTasks
- Inherits:
-
Object
- Object
- RubstApi::BackgroundTasks
- Defined in:
- lib/rubst_api/background_tasks.rb
Instance Method Summary collapse
- #add_task(callable = nil, *args, **kwargs, &block) ⇒ Object
- #call ⇒ Object
-
#initialize ⇒ BackgroundTasks
constructor
A new instance of BackgroundTasks.
Constructor Details
#initialize ⇒ BackgroundTasks
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 |
#call ⇒ Object
16 |
# File 'lib/rubst_api/background_tasks.rb', line 16 def call = @tasks.each(&:call) |