lib/redis/objects/hashes.rb in redis-objects-1.5.0 vs lib/redis/objects/hashes.rb in redis-objects-1.5.1

- old
+ new

@@ -24,9 +24,18 @@ Redis::HashKey.new( redis_field_key(name), redis_field_redis(name), redis_options(name) ) ) end + + define_method(:"#{name}=") do |values| + hash_key = public_send(name) + + redis.pipelined do + hash_key.clear + hash_key.bulk_set(values) + end + end end if options[:global] extend mod