Module: Oxblood::Commands::Connection
- Included in:
- Oxblood::Commands
- Defined in:
- lib/oxblood/commands/connection.rb
Instance Method Summary collapse
-
#auth(password) ⇒ String, RError
Authenticate to the server.
-
#echo(message) ⇒ String
Echo the given string.
-
#ping(message = nil) ⇒ String
Returns PONG if no argument is provided, otherwise return a copy of the argument as a bulk.
-
#quit ⇒ String
Close the connection.
-
#select(index) ⇒ String, RError
Change the selected database for the current connection.
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() run(:ECHO, ) 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( = nil) ? run(:PING, ) : run(:PING) end |
#quit ⇒ String
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 |