From 74c63e2fee1713f4368d3783e079829154aec651 Mon Sep 17 00:00:00 2001 From: Nicolas Pepin-Perreault Date: Fri, 9 Dec 2016 16:13:20 +0100 Subject: [PATCH] do not overload #delete method, which deletes the whole object --- lib/redstruct/types/hash.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/redstruct/types/hash.rb b/lib/redstruct/types/hash.rb index b9e5ae4..783f865 100644 --- a/lib/redstruct/types/hash.rb +++ b/lib/redstruct/types/hash.rb @@ -28,7 +28,7 @@ def update(hash) self.connection.mapped_hmset(@key, hash) end - def delete(*keys) + def remove(*keys) return self.connection.hdel(@key, keys) end @@ -45,7 +45,7 @@ def incr(key, increment: 1) end def decr(key, increment: 1) - return incr(key, (-increment)) + return incr(key, -increment) end def to_h