Accept proc and array for redis namespace

master
Guillaume Dott 2014-08-18 11:06:58 +02:00
parent 476c6045c4
commit 41b4abe0db
1 changed files with 5 additions and 1 deletions

View File

@ -17,7 +17,11 @@ module Flop
private private
def key(name) def key(name)
[@namespace, name].join(':') [namespace, name].flatten.join(':')
end
def namespace
@namespace.is_a?(Proc) ? @namespace.call : @namespace
end end
end end
end end