From 41b4abe0db0b0938eb5de1b30c0926dc9f346b57 Mon Sep 17 00:00:00 2001 From: Guillaume DOTT Date: Mon, 18 Aug 2014 11:06:58 +0200 Subject: [PATCH] Accept proc and array for redis namespace --- lib/flop/repository/redis.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/flop/repository/redis.rb b/lib/flop/repository/redis.rb index 6f0d253..c56872b 100644 --- a/lib/flop/repository/redis.rb +++ b/lib/flop/repository/redis.rb @@ -17,7 +17,11 @@ module Flop private def key(name) - [@namespace, name].join(':') + [namespace, name].flatten.join(':') + end + + def namespace + @namespace.is_a?(Proc) ? @namespace.call : @namespace end end end