Skip to content

Instantly share code, notes, and snippets.

@rkh
Created February 24, 2012 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rkh/1900123 to your computer and use it in GitHub Desktop.
Save rkh/1900123 to your computer and use it in GitHub Desktop.
class TrackMiddleware
def initialize(app, key = "track.middleware") @app, @key = app, key end
def call(env) app.call env.merge(@key => @app) end
end
use TrackMiddleware
map('/') { ... }
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment