Class: Rack::Reducer::Middleware
- Inherits:
-
Object
- Object
- Rack::Reducer::Middleware
- Defined in:
- lib/rack/reducer/middleware.rb
Overview
Mount Rack::Reducer as middleware
Instance Method Summary collapse
-
#call(env) ⇒ Object
Call the next app in the middleware stack, with env set to the ouput of a reduction.
-
#initialize(app, options = {}) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app, options = {}) ⇒ Middleware
Returns a new instance of Middleware.
23 24 25 26 27 |
# File 'lib/rack/reducer/middleware.rb', line 23 def initialize(app, = {}) @app = app @key = [:key] || 'rack.reduction' @reducer = Rack::Reducer.create([:dataset], *[:filters]) end |