Module: Oxblood::Commands::Connection

Included in:
Oxblood::Commands
Defined in:
lib/oxblood/commands/connection.rb

Instance Method Summary collapse

Instance Method Details

#auth(password) ⇒ String, RError

Authenticate to the server


12
13
14
# File 'lib/oxblood/commands/connection.rb', line 12

def auth(password)
  run(:AUTH, password)
end

#echo(message) ⇒ String

Echo the given string


22
23
24
# File 'lib/oxblood/commands/connection.rb', line 22

def echo(message)
  run(:ECHO, message)
end

#ping(message = nil) ⇒ String

Returns PONG if no argument is provided, otherwise return a copy of the argument as a bulk


33
34
35
# File 'lib/oxblood/commands/connection.rb', line 33

def ping(message = nil)
  message ? run(:PING, message) : run(:PING)
end

#quitString

Close the connection


52
53
54
55
56
# File 'lib/oxblood/commands/connection.rb', line 52

def quit
  run(:QUIT)
ensure
  connection.socket.close
end

#select(index) ⇒ String, RError

Change the selected database for the current connection


44
45
46
# File 'lib/oxblood/commands/connection.rb', line 44

def select(index)
  run(:SELECT, index)
end