lib/routemaster/middleware/expire_cache.rb in routemaster-drain-3.6.2 vs lib/routemaster/middleware/expire_cache.rb in routemaster-drain-3.6.3
- old
+ new
@@ -1,12 +1,12 @@
require 'routemaster/cache'
module Routemaster
module Middleware
class ExpireCache
- def initialize(app, cache:nil, **_)
+ def initialize(app, options = {})
@app = app
- @cache = cache || Routemaster::Cache.new
+ @cache = options.fetch(:cache) { Routemaster::Cache.new }
end
def call(env)
env.fetch('routemaster.payload', []).each do |event|
next if event['type'] == 'noop'