Skip to content

Instantly share code, notes, and snippets.

@pete
Created August 1, 2016 00:28
Show Gist options
  • Save pete/dffed6d4c513c3877a1ab4cc9b8b6c30 to your computer and use it in GitHub Desktop.
Save pete/dffed6d4c513c3877a1ab4cc9b8b6c30 to your computer and use it in GitHub Desktop.
Basic no-op version of Rack Middleware
class SomeMiddleware
attr_accessor :app
def initialize app
# The arguments passed to use() will end up here.
self.app = app
end
def call env
# This gets called when there's a request. It
# works like a pipeline.
@app.call env
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment