Class: Taskinator::CreateProcessWorker

Inherits:
Object
  • Object
show all
Defined in:
lib/taskinator/create_process_worker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(definition_name, uuid, args) ⇒ CreateProcessWorker

Returns a new instance of CreateProcessWorker.



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/taskinator/create_process_worker.rb', line 8

def initialize(definition_name, uuid, args)

  # convert to the module
  @definition = constantize(definition_name)

  # this will be uuid of the created process
  @uuid = uuid

  # convert to the typed arguments
  @args = Taskinator::Persistence.deserialize(args)

end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



6
7
8
# File 'lib/taskinator/create_process_worker.rb', line 6

def args
  @args
end

#definitionObject (readonly)

Returns the value of attribute definition.



4
5
6
# File 'lib/taskinator/create_process_worker.rb', line 4

def definition
  @definition
end

#uuidObject (readonly)

Returns the value of attribute uuid.



5
6
7
# File 'lib/taskinator/create_process_worker.rb', line 5

def uuid
  @uuid
end

Instance Method Details

#performObject



21
22
23
# File 'lib/taskinator/create_process_worker.rb', line 21

def perform
  @definition._create_process_(*@args, :uuid => @uuid).enqueue!
end