module Redis::Commands::Server

def client(subcommand, *args)

Returns:
  • (String, Hash) - depends on subcommand

Parameters:
  • subcommand (String, Symbol) -- e.g. `kill`, `list`, `getname`, `setname`
def client(subcommand, *args)
  send_command([: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