Class: Operationable::Runners::Serial
- Inherits:
-
Base
- Object
- Base
- Operationable::Runners::Serial
show all
- Defined in:
- lib/operationable/runners/serial.rb
Instance Attribute Summary
Attributes inherited from Base
#callbacks, #params, #record, #result, #user
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Class Method Details
.call(options, props) ⇒ Object
13
14
15
16
|
# File 'lib/operationable/runners/serial.rb', line 13
def self.call(options, props)
instance = options[:callback_class_name].constantize.new(props)
options[:callback_names].each { |method_name| instance.method(method_name).call }
end
|
Instance Method Details
#options ⇒ Object
18
19
20
21
22
23
|
# File 'lib/operationable/runners/serial.rb', line 18
def options
{ type: 'serial',
callback_class_name: callback_class_name,
callback_names: callback_names,
queue: queue }
end
|
#process ⇒ Object
9
10
11
|
# File 'lib/operationable/runners/serial.rb', line 9
def process
(queue.blank? ? self.class : OperationJob.method(perform_method)).call(options, props)
end
|
#run ⇒ Object
5
6
7
|
# File 'lib/operationable/runners/serial.rb', line 5
def run
process
end
|