Module: Redis::Connection::CommandHelper

Included in:
Ruby, Synchrony
Defined in:
lib/redis/connection/command_helper.rb

Constant Summary collapse

COMMAND_DELIMITER =
"\r\n"

Instance Method Summary collapse

Instance Method Details

#build_command(*args) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/redis/connection/command_helper.rb', line 7

def build_command(*args)
  command = []
  command << "*#{args.size}"

  args.each do |arg|
    arg = arg.to_s
    command << "$#{string_size arg}"
    command << arg
  end

  # Trailing delimiter
  command << ""
  command
end