Class: WipeOut::Execute

Inherits:
Object
  • Object
show all
Defined in:
lib/wipe_out/execute.rb

Overview

Executes plan for a given record. Plan execution flow:

  • emit event: #before_plan

For each record (recursively, depth first)

  • emit event: #before_execution
  • emit event: #after_execution

After plan had been executed (won't run if exception had been raised)

  • emit event: #after_plan

To see how plan is defined, see Plans::Dsl To configure, see Config

Instance Method Summary collapse

Instance Method Details

#callObject



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/wipe_out/execute.rb', line 19

def call
  ar_class.transaction do
    execution = Execution::Context.new(plan, record)

    execution.notify(:before_plan)

    Execution::ExecutePlan.call(execution)

    execution.notify(:after_plan)
  end
end