Module: Operation::Execute

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

Instance Method Summary collapse

Instance Method Details

#behaviorObject



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

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

#executeObject



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

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

  self
end

#execute!Object



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

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

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

  self
end