Class: RDKit::RESPRunner

Inherits:
Object
  • Object
show all
Includes:
Inheritable, RedisCompatibility
Defined in:
lib/rdkit/resp_runner.rb

Defined Under Namespace

Modules: RedisCompatibility

Instance Method Summary collapse

Methods included from RedisCompatibility

#ping, #select

Methods included from Inheritable

included

Instance Method Details

#infoObject

获取服务器状态



12
13
14
15
16
# File 'lib/rdkit/resp_runner.rb', line 12

def info
  Introspection.info.map do |type, value|
    "# #{type.capitalize}\r\n" + value.map { |k, v| "#{k}:#{v}" }.join("\r\n") + "\r\n"
  end.join("\r\n") + "\r\n"
end

#resp(cmd) ⇒ Object



5
6
7
8
9
# File 'lib/rdkit/resp_runner.rb', line 5

def resp(cmd)
  RESP.compose(call(cmd))
rescue => e
  RESP.compose(e)
end