class Redis
def client(subcommand = nil, *args)
-
(String, Hash)
- depends on subcommand
Parameters:
-
subcommand
(String, Symbol
) -- e.g. `kill`, `list`, `getname`, `setname`
def client(subcommand = nil, *args) synchronize do |client| client.call([:client, subcommand] + args) do |reply| if subcommand.to_s == "list" reply.lines.map do |line| entries = line.chomp.split(/[ =]/) Hash[entries.each_slice(2).to_a] end else reply end end end end