Browse files

Document using memoizer middleware.

  • Loading branch information...
1 parent bc562ff commit 8d8c763473bc0cbe1aa646bc8f79b6b7fbccee11 @jnunemaker committed Feb 19, 2013
Showing with 16 additions and 0 deletions.
  1. +16 −0 lib/flipper/middleware/memoizer.rb
View
16 lib/flipper/middleware/memoizer.rb
@@ -3,6 +3,22 @@
module Flipper
module Middleware
class Memoizer
+ # 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::Middleware::Memoizer, flipper
+ #
+ # # using with a block that yields a flipper instance
+ # use Flipper::Middleware::Memoizer, lambda { Flipper.new(...) }
+ #
def initialize(app, flipper_or_block)
@app = app

0 comments on commit 8d8c763

Please sign in to comment.