module Flow::Flow::Flux

Public Instance Methods

_flux() click to toggle source
# File lib/flow/flow/flux.rb, line 20
def _flux
  executable_operations.each do |operation|
    operation.execute
    (@failed_operation = operation) and raise Flow::Flux::Failure if operation.failed?
    executed_operations << operation
  end
end
executable_operations() click to toggle source
# File lib/flow/flow/flux.rb, line 28
def executable_operations
  operation_instances - executed_operations
end
failed_operation?() click to toggle source
# File lib/flow/flow/flux.rb, line 38
def failed_operation?
  failed_operation.present?
end
flux() click to toggle source
# File lib/flow/flow/flux.rb, line 42
def flux
  flux!
rescue StandardError => exception
  info :error_executing_operation, state: state, exception: exception

  raise exception unless exception.is_a? Flow::Flux::Failure
end
flux!() click to toggle source
# File lib/flow/flow/flux.rb, line 50
def flux!
  run_callbacks(:flux) { _flux }
end
operation_instances() click to toggle source
# File lib/flow/flow/flux.rb, line 32
def operation_instances
  _operations.map { |operation_class| operation_class.new(state) }
end