]> git.saurik.com Git - redis.git/commitdiff
RubyRedis: Array alike operators implemented
authorantirez <antirez@gmail.com>
Wed, 20 May 2009 15:34:20 +0000 (17:34 +0200)
committerantirez <antirez@gmail.com>
Wed, 20 May 2009 15:34:20 +0000 (17:34 +0200)
client-libraries/ruby_2/rubyredis.rb

index a6a7408f40963f12c06b77cd8adcda44695396ca..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]