X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/4e1684df0921c6d49f2e5f89927b2f068f0efa91..ad0ea27c83f23819c515116117413a1a86555c36:/client-libraries/ruby_2/rubyredis.rb diff --git a/client-libraries/ruby_2/rubyredis.rb b/client-libraries/ruby_2/rubyredis.rb index 117f2efa..9be390e3 100644 --- a/client-libraries/ruby_2/rubyredis.rb +++ b/client-libraries/ruby_2/rubyredis.rb @@ -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("*")