]> git.saurik.com Git - redis.git/blobdiff - client-libraries/ruby_2/rubyredis.rb
RubyRedis: Array alike operators implemented
[redis.git] / client-libraries / ruby_2 / rubyredis.rb
index 117f2efa1591b5a93e0d23fbc20f3b53d39f582d..9be390e3eaba8afb992ededb7feb8f74e648cedb 100644 (file)
@@ -51,6 +51,14 @@ class RedisClient
         raise "SELECT not allowed, use the :db option when creating the object"
     end
 
+    def [](key)
+        get(key)
+    end
+
+    def []=(key,value)
+        set(key,value)
+    end
+
     def read_reply
         line = @sock.gets
         case line[0..0]
@@ -77,6 +85,3 @@ class RedisClient
         end
     end
 end
-
-r = RedisClient.new(:db=>0)
-p r.keys("*")