Ruby will "expand" the array into a list of arguments. That should get
you the result you desire.
> I have a quick question about using the redis-rb client and its
> mapped_mget() method... I've looked through the source to see how it
> might be used, and I've found what seems like some unexpected
> behavior. It may be that there's a different way to do this, but if
> not I can look at potentially patching it if it seems like an
> improvement.
> After getting a bunch of keys from set 'objects' (just for example purposes):
> redis.sort('objects', { :limit => [ offset, per_page ])
> I then want to turn around and use mget to grab the details of the
> items. I also want the keys for each one, and it seems that
> mapped_mget() is for this purpose? So I tried:
> p = r.mapped_mget(r.sort('objects', { :limit => [0, 5]}))
> Unfortunately, it looks as though mapped_mget() will only take a list
> of keys, not an array? What I get back is:
> p.keys
> => [["object:5459789:data", "object:5893120:data",
> "object:7232572:data", "object:7312762:data", "object:5235635:data"],
> nil]
> The array itself is returned as the first key, followed by nil. But if
> I do this:
> p = r.mapped_mget("object:5459789:data", "object:5893120:data")
> p.keys
> => ["object:5459789:data", "object:5893120:data"]
> That works as expected, with each key mapped to its value.
> Does it seem reasonable to expect that mapped_mget() could take an
> array, and then the results of a set() call can be passed directly in,
> as I showed above?
> Thanks!