app/utils/context_runner.rb
# Build a context map for execution. The context map is just a
# hash but the context execution mechanism defines a small set
# of reserved keys that it uses to control the execution
# process. All other keys are free to be used by the middleware
# implementations to pass on information in the chain.
#
# ==== Context Hash
# * <tt>params</tt> - The parameters passed to execute. Executor
# has no use for these parameters so interpreting them is
# entirely up to middleware.
# * <tt>enter_queue</tt> - A queue (impl Array) of middlewares
# that still need to be executed during the 'enter' phase.
# * <tt>leave_stack</tt> - A stack (impl Array) of middlewares
# that still need to be executed during the 'leave' phase.
# * <tt>error</tt> - The most recently uncaught error. If a
# middleware raises an error the next middleware in the stack
# will have its error method called with ctx and the error. If
# the error method either raises a new error, reraises the same
# error or returns the ctx with error key in place the error
# handling will proceed to call the next middleware in the
# stack. A middleware error handler can resolve an error by
# returning a context with the error key removed (or set to
# nil). In this case the context running will proceed to call
# leave functions of all remaining middleware in the stack.
Build a context map for execution. The context map is just a
hash but the context execution mechanism defines a small set
of reserved keys that it uses to control the execution
process. All other keys are free to be used by the middleware
implementations to pass on information in the chain.

Context Hash
params - The parameters passed to execute. Executor
has no use for these parameters so interpreting them is
entirely up to middleware.
enter_queue - A queue (impl Array) of middlewares
that still need to be executed during the 'enter' phase.
leave_stack - A stack (impl Array) of middlewares
that still need to be executed during the 'leave' phase.
error - The most recently uncaught error. If a
middleware raises an error the next middleware in the stack
will have its error method called with ctx and the error. If
the error method either raises a new error, reraises the same
error or returns the ctx with error key in place the error
handling will proceed to call the next middleware in the
stack. A middleware error handler can resolve an error by
returning a context with the error key removed (or set to
nil). In this case the context running will proceed to call
leave functions of all remaining middleware in the stack.
Build a context map for execution . The context map is just a hash but the context execution mechanism defines a small set of reserved keys that it uses to control the execution process . All other keys are free to be used by the middleware implementations to pass on information in the chain . Context Hash params - The parameters passed to execute . Executor has no use for these parameters so interpreting them is entirely up to middleware . enter_queue - A queue ( impl Array ) of middlewares that still need to be executed during the ' enter ' phase . leave_stack - A stack ( impl Array ) of middlewares that still need to be executed during the ' leave ' phase . error - The most recently uncaught error . If a middleware raises an error the next middleware in the stack will have its error method called with ctx and the error . If the error method either raises a new error reraises the same error or returns the ctx with error key in place the error handling will proceed to call the next middleware in the stack . A middleware error handler can resolve an error by returning a context with the error key removed ( or set to nil ) . In this case the context running will proceed to call leave functions of all remaining middleware in the stack .
def build_ctx(params)
    (params || {}).merge(
      enter_queue: build_enter_queue(params, middleware),
      leave_stack: [])
  end
def build_ctx ( params ) ( params || { } ) . merge ( enter_queue : build_enter_queue ( params , middleware ) , leave_stack : [ ] ) end
Build a context map for execution.
Build a context map for execution .
params