module Interactor::Organizer::ClassMethods

Internal: Interactor::Organizer class methods.

Public Instance Methods

organize(*interactors) click to toggle source

Public: Declare Interactors to be invoked as part of the Interactor::Organizer's invocation. These interactors are invoked in the order in which they are declared.

interactors - Zero or more (or an Array of) Interactor classes.

Examples

class MyFirstOrganizer
  include Interactor::Organizer

  organize InteractorOne, InteractorTwo
end

class MySecondOrganizer
  include Interactor::Organizer

  organize [InteractorThree, InteractorFour]
end

Returns nothing.

# File lib/interactor/organizer.rb, line 47
def organize(*interactors)
  @organized = interactors.flatten
end
organized() click to toggle source

Internal: An Array of declared Interactors to be invoked.

Examples

class MyOrganizer
  include Interactor::Organizer

  organize InteractorOne, InteractorTwo
end

MyOrganizer.organized
# => [InteractorOne, InteractorTwo]

Returns an Array of Interactor classes or an empty Array.

# File lib/interactor/organizer.rb, line 65
def organized
  @organized ||= []
end