nest
nest copied to clipboard
Add some extensions
I'm not sure where did I copy these extensions from, perhaps redis-ruby. These extensions let nest use hash directly. I find them very useful. Do you think we can add them to the gem?
Nest.class_eval do
def mapped_hmget(*fields)
Hash[**hmget(*fields)]
end
def mapped_hgetall
Hash[*hgetall]
end
def mapped_hmset(values)
hmset(*values.to_a.flatten)
end
end