about summary refs log tree commit diff
path: root/lib/redis
diff options
context:
space:
mode:
Diffstat (limited to 'lib/redis')
-rw-r--r--lib/redis/namespace_extensions.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/redis/namespace_extensions.rb b/lib/redis/namespace_extensions.rb
new file mode 100644
index 000000000..310a4f465
--- /dev/null
+++ b/lib/redis/namespace_extensions.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+class Redis
+  module NamespaceExtensions
+    def exists?(*args, &block)
+      call_with_namespace('exists?', *args, &block)
+    end
+  end
+end
+
+Redis::Namespace::COMMANDS['exists?'] = [:first]
+Redis::Namespace.prepend(Redis::NamespaceExtensions)