Permalink
Browse files

Doc using the middleware.

  • Loading branch information...
1 parent f12eaee commit 10da5002a24d8d8147d42160ccea667907e27afb @jnunemaker committed Feb 19, 2013
Showing with 16 additions and 0 deletions.
  1. +16 −0 lib/flipper/ui/middleware.rb
@@ -9,6 +9,22 @@
module Flipper
module UI
class Middleware
+ # Public: Initializes an instance of the UI middleware.
+ #
+ # app - The app this middleware is included in.
+ # flipper_or_block - The Flipper::DSL instance or a block that yields a
+ # Flipper::DSL instance to use for all operations.
+ #
+ # Examples
+ #
+ # flipper = Flipper.new(...)
+ #
+ # # using with a normal flipper instance
+ # use Flipper::UI::Middleware, flipper
+ #
+ # # using with a block that yields a flipper instance
+ # use Flipper::UI::Middleware, lambda { Flipper.new(...) }
+ #
def initialize(app, flipper_or_block)
@app = app

0 comments on commit 10da500

Please sign in to comment.