Method: ActiveInteractor::Interactor::Perform::ClassMethods#perform

Defined in:
lib/active_interactor/interactor/perform.rb

#perform(context = {}, options = {}) ⇒ Class

Initialize a new interactor instance and call its #perform method. This is the default api to interact with all interactors.

Examples:

class MyInteractor < ActiveInteractor::Base
  def perform
    puts "I performed"
  end
end

MyInteractor.perform
"I performed"
#=> <#MyInteractor::Context>

Since:

  • 0.1.0



38
39
40
# File 'lib/active_interactor/interactor/perform.rb', line 38

def perform(context = {}, options = {})
  new(context).with_options(options).execute_perform
end