lib/nest.rb in nest-0.0.6 vs lib/nest.rb in nest-0.0.7

- old
+ new

@@ -1,18 +1,21 @@ class Nest < String - VERSION = "0.0.6" + VERSION = "0.0.7" + METHODS = [:append, :blpop, :brpop, :decr, :decrby, :del, :exists, :expire, :expireat, :get, :getset, :hdel, :hexists, :hget, :hgetall, - :hincrby, :hkeys, :hlen, :hmget, :hmset, :hset, :hvals, :incr, - :incrby, :lindex, :llen, :lpop, :lpush, :lrange, :lrem, :lset, - :ltrim, :mapped_hmset, :move, :rename, :renamenx, :rpop, :rpoplpush, - :rpush, :sadd, :scard, :sdiff, :sdiffstore, :set, :setex, :setnx, - :sinter, :sinterstore, :sismember, :smembers, :smove, :sort, :spop, - :srandmember, :srem, :substr, :sunion, :sunionstore, :ttl, :type, - :unwatch, :watch, :zadd, :zcard, :zincrby, :zinterstore, :zrange, - :zrangebyscore, :zrank, :zrem, :zremrangebyrank, :zremrangebyscore, - :zrevrange, :zrevrank, :zscore, :zunionstore] + :hincrby, :hkeys, :hlen, :hmget, :hmset, :hset, :hsetnx, :hvals, + :incr, :incrby, :lindex, :linsert, :llen, :lpop, :lpush, :lpushx, + :lrange, :lrem, :lset, :ltrim, :move, :psubscribe, :publish, + :punsubscribe, :rename, :renamenx, :rpop, :rpoplpush, :rpush, + :rpushx, :sadd, :scard, :sdiff, :sdiffstore, :set, :setex, :setnx, + :sinter, :sinterstore, :sismember, :smembers, :smove, :sort, + :spop, :srandmember, :srem, :strlen, :subscribe, :substr, :sunion, + :sunionstore, :ttl, :type, :unsubscribe, :watch, :zadd, :zcard, + :zcount, :zincrby, :zinterstore, :zrange, :zrangebyscore, :zrank, + :zrem, :zremrangebyrank, :zremrangebyscore, :zrevrange, :zrevrank, + :zscore, :zunionstore] def initialize(key, redis = nil) super(key.to_s) @redis = redis end @@ -20,11 +23,11 @@ def [](key) self.class.new("#{self}:#{key}", redis) end METHODS.each do |meth| - define_method(meth) do |*args| - redis.send(meth, self, *args) + define_method(meth) do |*args, &block| + redis.send(meth, self, *args, &block) end end private