module Redis::Commands::Connection
Public Instance Methods
Source
# File lib/redis/commands/connection.rb, line 12 def auth(*args) send_command([:auth, *args]) end
Authenticate to the server.
@param [Array<String>] args includes both username and password
or only password
@return [String] ‘OK` @see redis.io/commands/auth AUTH command
Source
# File lib/redis/commands/connection.rb, line 28 def echo(value) send_command([:echo, value]) end
Echo the given string.
@param [String] value @return [String]
Source
# File lib/redis/commands/connection.rb, line 20 def ping(message = nil) send_command([:ping, message].compact) end
Ping the server.
@param [optional, String] message @return [String] ‘PONG`
Source
# File lib/redis/commands/connection.rb, line 43 def quit synchronize do |client| client.call_v([:quit]) rescue ConnectionError ensure client.close end end
Close the connection.
@return [String] ‘OK`
Source
# File lib/redis/commands/connection.rb, line 36 def select(db) send_command([:select, db]) end
Change the selected database for the current connection.
@param [Integer] db zero-based index of the DB to use (0 to 15) @return [String] ‘OK`