module Oxblood::Commands::Connection
Public Instance Methods
auth(password)
click to toggle source
Authenticate to the server @see redis.io/commands/auth
@param [String] password
@return [String] 'OK' @return [RError] if wrong password was passed or server does not require
password
# File lib/oxblood/commands/connection.rb, line 12 def auth(password) run(:AUTH, password) end
echo(message)
click to toggle source
Echo the given string @see redis.io/commands/echo
@param [String] message
@return [String] given string
# File lib/oxblood/commands/connection.rb, line 22 def echo(message) run(:ECHO, message) end
ping(message = nil)
click to toggle source
Returns PONG if no argument is provided, otherwise return a copy of the argument as a bulk @see redis.io/commands/ping
@param [String] message to return
@return [String] message passed as argument
# File lib/oxblood/commands/connection.rb, line 33 def ping(message = nil) message ? run(:PING, message) : run(:PING) end
quit()
click to toggle source
Close the connection @see redis.io/commands/quit
@return [String] 'OK'
# File lib/oxblood/commands/connection.rb, line 52 def quit run(:QUIT) ensure connection.socket.close end
select(index)
click to toggle source
Change the selected database for the current connection @see redis.io/commands/select
@param [Integer] index database to switch
@return [String] 'OK' @return [RError] if wrong index was passed
# File lib/oxblood/commands/connection.rb, line 44 def select(index) run(:SELECT, index) end