Module: Flow::Operation::Execute

Extended by:
ActiveSupport::Concern
Included in:
Flow::OperationBase
Defined in:
lib/flow/operation/execute.rb

Instance Method Summary collapse

Instance Method Details

#behaviorObject



38
39
40
# File 'lib/flow/operation/execute.rb', line 38

def behavior
  # abstract method which should be defined by descendants with the functionality of the given operation
end

#executeObject



30
31
32
33
34
35
36
# File 'lib/flow/operation/execute.rb', line 30

def execute
  execute!
rescue Operation::Failures::OperationFailure => exception
  @operation_failure = exception

  self
end

#execute!Object



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

def execute!
  run_callbacks(:execute) do
    run_callbacks(:behavior) { behavior }
  end

  self
rescue StandardError => exception
  rescue_with_handler(exception) || raise

  self
end