Method: ActiveInteractor::Interactor::Callbacks::ClassMethods#after_perform

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

#after_perform(*filters, &block) ⇒ Object

Define a callback to call after #perform has been called on an interactor instance.

Examples:

class MyInteractor < ActiveInteractor::Base
  after_perform :print_done

  def perform
    puts 'Performing'
  end

  private

  def print_done
    puts 'Done'
  end
end

MyInteractor.perform
"Performing"
"Done"
#=> <#MyInteractor::Context>

Since:

  • 0.1.0



68
69
70
# File 'lib/active_interactor/interactor/callbacks.rb', line 68

def after_perform(*filters, &block)
  set_callback(:perform, :after, *filters, &block)
end