Module: Houdini::TaskManager

Defined in:
lib/houdini/task_manager.rb

Class Method Summary collapse

Class Method Details

.process(class_name, id, blueprint, output, verbose_output) ⇒ Object



15
16
17
18
19
# File 'lib/houdini/task_manager.rb', line 15

def self.process(class_name, id, blueprint, output, verbose_output)
  class_name.constantize # Ensure model is loaded and any Houdini tasks registered
  task = @tasks[ [class_name, blueprint.to_sym] ]
  task.process id, output, verbose_output
end

.register(klass, blueprint, options, task_builder = Task) ⇒ Object



3
4
5
6
# File 'lib/houdini/task_manager.rb', line 3

def self.register(klass, blueprint, options, task_builder=Task)
  @tasks ||= {}
  @tasks[ [klass.name, blueprint.to_sym] ] = task_builder.new(klass, blueprint, options)
end

.submit!(object, blueprint) ⇒ Object



8
9
10
11
12
13
# File 'lib/houdini/task_manager.rb', line 8

def self.submit!(object, blueprint)
  if @tasks
    task = @tasks[ [object.class.name, blueprint.to_sym] ]
    task.submit! object
  end
end