@port = opts[:port]
@db = opts[:db]
@sock = connect_to_server
+ call_command(["select",@db]) if @db != 0
end
def to_s
read_reply
end
+ def select(*args)
+ 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]