Method: Redis::Commands::Lists#lmpop
- Defined in:
- lib/redis/commands/lists.rb
#lmpop(*keys, modifier: "LEFT", count: nil) ⇒ Array<String, Array<String, Float>>
Pops one or more elements from the first non-empty list key from the list of provided key names.
231 232 233 234 235 236 237 238 |
# File 'lib/redis/commands/lists.rb', line 231 def lmpop(*keys, modifier: "LEFT", count: nil) raise ArgumentError, "Pick either LEFT or RIGHT" unless modifier == "LEFT" || modifier == "RIGHT" args = [:lmpop, keys.size, *keys, modifier] args << "COUNT" << Integer(count) if count send_command(args) end |