Module: ActiveInteractor::Organizer::Perform
- Included in:
- Base
- Defined in:
- lib/active_interactor/organizer/perform.rb
Overview
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#perform ⇒ Object
Call the .organized interactors #perform.
- #run_deferred_after_perform_callbacks_on_children ⇒ Object
Class Method Details
.included(base) ⇒ Object
39 40 41 42 43 |
# File 'lib/active_interactor/organizer/perform.rb', line 39 def self.included(base) base.class_eval do class_attribute :parallel, instance_writer: false, default: false end end |
Instance Method Details
#perform ⇒ Object
Call the .organized interactors #perform. An organizer is expected not to define its own #perform method in favor of this default implementation.
48 49 50 51 52 53 54 55 56 |
# File 'lib/active_interactor/organizer/perform.rb', line 48 def perform run_callbacks :all_perform do if self.class.parallel perform_in_parallel else perform_in_order end end end |
#run_deferred_after_perform_callbacks_on_children ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/active_interactor/organizer/perform.rb', line 58 def run_deferred_after_perform_callbacks_on_children self.class.organized.each do |interface| next unless interface.interactor_class.after_callbacks_deferred_when_organized context.merge!(interface.execute_deferred_after_perform_callbacks(context)) end end |