Method: Redis::Commands::Hashes#mapped_hmget
- Defined in:
- lib/redis/commands/hashes.rb
#mapped_hmget(key, *fields) ⇒ Hash
Get the values of all the given hash fields.
105 106 107 108 109 110 111 112 113 114 |
# File 'lib/redis/commands/hashes.rb', line 105 def mapped_hmget(key, *fields) fields.flatten!(1) hmget(key, fields) do |reply| if reply.is_a?(Array) Hash[fields.zip(reply)] else reply end end end |