Sha256: c433be1579908317a167d7beda5e2c9035d4d300dc83b5be1c7e44b5ec121210
Contents?: true
Size: 872 Bytes
Versions: 52
Compression:
Stored size: 872 Bytes
Contents
class Redis module Connection module CommandHelper COMMAND_DELIMITER = "\r\n" 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.join(COMMAND_DELIMITER) end protected if "".respond_to?(:bytesize) def string_size(string) string.to_s.bytesize end else def string_size(string) string.to_s.size end end if defined?(Encoding::default_external) def encode(string) string.force_encoding(Encoding::default_external) end else def encode(string) string end end end end end
Version data entries
52 entries across 52 versions & 6 rubygems