Evaluate Lua script.
EVAL without KEYS nor ARGV
redis.eval("return 1") # => 1
EVAL with KEYS and ARGV as array arguments
redis.eval("return { KEYS, ARGV }", ["k1", "k2"], ["a1", "a2"]) # => [["k1", "k2"], ["a1", "a2"]]
EVAL with KEYS and ARGV in a hash argument
redis.eval("return { KEYS, ARGV }", :keys => ["k1", "k2"], :argv => ["a1", "a2"]) # => [["k1", "k2"], ["a1", "a2"]]
Parameters:
optional array with keys to pass to the script
optional array with arguments to pass to the script
:keys => Array<String>
:argv => Array<String>
Returns:
depends on the script
See Also:
71 72 73
# File 'lib/redis/commands/scripting.rb', line 71 def eval(*args) _eval(:eval, args) end