module Redis::Commands

def call(*command, &block)

Redis error replies are raised as Ruby exceptions.

hash, are up to consumers.
level transformations, such as converting an array of pairs into a Ruby
you can expect a Ruby array, integer or nil when Redis sends one. Higher
Replies are converted to Ruby objects according to the RESP protocol, so

Sends a command to Redis and returns its reply.
def call(*command, &block)
  send_command(command, &block)
end

def method_missing(*command) # rubocop:disable Style/MissingRespondToMissing

rubocop:disable Style/MissingRespondToMissing
def method_missing(*command) # rubocop:disable Style/MissingRespondToMissing
  send_command(command)
end

def sentinel(subcommand, *args)

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

Parameters:
  • args (Array) -- depends on subcommand
  • subcommand (String) -- e.g. `masters`, `master`, `slaves`
def sentinel(subcommand, *args)
  subcommand = subcommand.to_s.downcase
  send_command([:sentinel, subcommand] + args) do |reply|
    case subcommand
    when "get-master-addr-by-name"
      reply
    else
      if reply.is_a?(Array)
        if reply[0].is_a?(Array)
          reply.map(&Hashify)
        else
          Hashify.call(reply)
        end
      else
        reply
      end
    end
  end
end