Make Model.expire act like the other options, and add tests for it

This commit is contained in:
2012-04-18 15:08:25 +01:00
parent fccf0db68a
commit e15f637603
4 changed files with 24 additions and 2 deletions

View File

@@ -46,8 +46,12 @@ module Redistat
alias :class_name :scope
def expire(exp)
options[:expire] = exp.is_a?(Hash) ? exp : Hash.new(exp)
def expire(exp = nil)
if !exp.nil?
options[:expire] = exp.is_a?(Hash) ? exp : Hash.new(exp)
else
options[:expire]
end
end
def connect_to(opts = {})