lib/protocol/redis/methods/server.rb in protocol-redis-0.2.0 vs lib/protocol/redis/methods/server.rb in protocol-redis-0.3.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
# Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
# Copyright, 2018, by Huba Nagy.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -21,12 +23,13 @@
module Protocol
module Redis
module Methods
module Server
- # Get info from server.
- # @return [Hash] the server metadata.
+ # Get information and statistics about the server.
+ # @see https://redis.io/commands/info
+ # @param section [String]
def info
metadata = {}
call('INFO').each_line(Protocol::CRLF) do |line|
key, value = line.split(':')
@@ -37,11 +40,14 @@
end
return metadata
end
+ # Remove all keys from the current database.
+ # @see https://redis.io/commands/flushdb
+ # @param async [Enum]
def flushdb!
- call 'FLUSHDB'
+ return call('FLUSHDB')
end
end
end
end
end