class Redis

def mapped_mget(*keys)

Other tags:
    See: #mget -

Returns:
  • (Hash) - a hash mapping the specified keys to their values

Parameters:
  • keys (Array) -- array of keys
def mapped_mget(*keys)
  mget(*keys) do |reply|
    if reply.kind_of?(Array)
      hash = Hash.new
      keys.zip(reply).each do |field, value|
        hash[field] = value
      end
      hash
    else
      reply
    end
  end
end