Class Middleware::Runner
In: lib/middleware/runner.rb
Parent: Object

This is a basic runner for middleware stacks. This runner does the default expected behavior of running the middleware stacks in order, then reversing the order.

Methods

build_call_chain   call   new  

Constants

EMPTY_MIDDLEWARE = lambda { |env| }   A middleware which does nothing

Public Class methods

Build a new middleware runner with the given middleware stack.

Note: This class usually doesn‘t need to be used directly. Instead, take a look at using the {Builder} class, which is a much friendlier way to build up a middleware stack.

@param [Array] stack An array of the middleware to run.

Public Instance methods

Run the middleware stack with the given state bag.

@param [Object] env The state to pass into as the initial

  environment data. This is usual a hash of some sort.

Protected Instance methods

This takes a stack of middlewares and initializes them in a way that each middleware properly calls the next middleware.

[Validate]