Module: ActiveInteractor::Organizer::Perform

Included in:
Base
Defined in:
lib/active_interactor/organizer/perform.rb

Overview

Organizer perform methods. Because Perform is a module classes should include Perform rather than inherit from it.

Author:

Since:

  • 1.0.0

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Since:

  • 1.0.0



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

#performObject

Call the .organized interactors #perform. An organizer is expected not to define its own #perform method in favor of this default implementation.

Since:

  • 1.0.0



48
49
50
51
52
53
54
# File 'lib/active_interactor/organizer/perform.rb', line 48

def perform
  if self.class.parallel
    perform_in_parallel
  else
    perform_in_order
  end
end