lib/flipper/middleware/memoizer.rb in flipper-0.11.0.beta1 vs lib/flipper/middleware/memoizer.rb in flipper-0.11.0.beta3

- old
+ new

@@ -6,10 +6,13 @@ # Public: Initializes an instance of the Memoizer middleware. The flipper # instance must be setup in the env of the request. You can do this by # using the Flipper::Middleware::SetupEnv middleware. # # app - The app this middleware is included in. + # opts - The Hash of options. + # :preload_all - Boolean of whether or not to preload all features. + # :preload - Array of Symbol feature names to preload. # # Examples # # use Flipper::Middleware::Memoizer # @@ -18,9 +21,13 @@ # # # using with preload specific features # use Flipper::Middleware::Memoizer, preload: [:stats, :search, :some_feature] # def initialize(app, opts = {}) + if opts.is_a?(Flipper::DSL) || opts.is_a?(Proc) + raise 'Flipper::Middleware::Memoizer no longer initializes with a flipper instance or block. Read more at: https://git.io/vSo31.' # rubocop:disable LineLength + end + @app = app @opts = opts end def call(env)