lib/redis/value.rb in redis-objects-1.1.0 vs lib/redis/value.rb in redis-objects-1.2.0

- old
+ new

@@ -13,14 +13,16 @@ super(key, *args) redis.setnx(key, marshal(@options[:default])) if !@options[:default].nil? end def value=(val) - if val.nil? - delete - else - redis.set key, marshal(val) + allow_expiration do + if val.nil? + delete + else + redis.set key, marshal(val) + end end end alias_method :set, :value= def value @@ -38,9 +40,7 @@ def to_json(*args); value.to_json *args end def method_missing(*args) self.value.send *args end - - expiration_filter :value= end end