Skip to content

Instantly share code, notes, and snippets.

@rkh
Created February 24, 2012 10:59
Show Gist options
  • 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