@@ -764,7 +764,7 @@ def msetnx(*args)
764764 # Set one or more values, only if none of the keys exist.
765765 #
766766 # @example
767- # redis.msetnx ({ "key1" => "v1", "key2" => "v2" })
767+ # redis.mapped_msetnx ({ "key1" => "v1", "key2" => "v2" })
768768 # # => true
769769 #
770770 # @param [Hash] hash keys mapping to values
@@ -1620,6 +1620,28 @@ def zrangebylex(key, min, max, options = {})
16201620 end
16211621 end
16221622
1623+ # Return a range of members with the same score in a sorted set, by reversed lexicographical ordering.
1624+ # Apart from the reversed ordering, #zrevrangebylex is similar to #zrangebylex.
1625+ #
1626+ # @example Retrieve members matching a
1627+ # redis.zrevrangebylex("zset", "[a", "[a\xff")
1628+ # # => ["abbygail", "abby", "abagael", "aaren"]
1629+ # @example Retrieve the last 2 members matching a
1630+ # redis.zrevrangebylex("zset", "[a", "[a\xff", :limit => [0, 2])
1631+ # # => ["abbygail", "abby"]
1632+ #
1633+ # @see #zrangebylex
1634+ def zrevrangebylex ( key , max , min , options = { } )
1635+ args = [ ]
1636+
1637+ limit = options [ :limit ]
1638+ args . concat ( [ "LIMIT" ] + limit ) if limit
1639+
1640+ synchronize do |client |
1641+ client . call ( [ :zrevrangebylex , key , max , min ] + args )
1642+ end
1643+ end
1644+
16231645 # Return a range of members in a sorted set, by score.
16241646 #
16251647 # @example Retrieve members with score `>= 5` and `< 100`
@@ -1895,7 +1917,7 @@ def hmget(key, *fields, &blk)
18951917 # Get the values of all the given hash fields.
18961918 #
18971919 # @example
1898- # redis.hmget ("hash", "f1", "f2")
1920+ # redis.mapped_hmget ("hash", "f1", "f2")
18991921 # # => { "f1" => "v1", "f2" => "v2" }
19001922 #
19011923 # @param [String] key
@@ -2032,7 +2054,7 @@ def punsubscribe(*channels)
20322054 end
20332055 end
20342056
2035- # Inspect the state of the Pub/Sub subsystem.
2057+ # Inspect the state of the Pub/Sub subsystem.
20362058 # Possible subcommands: channels, numsub, numpat.
20372059 def pubsub ( subcommand , *args )
20382060 synchronize do |client |
@@ -2458,7 +2480,7 @@ def sscan(key, cursor, options={})
24582480 # Scan a set
24592481 #
24602482 # @example Retrieve all of the keys in a set
2461- # redis.sscan ("set").to_a
2483+ # redis.sscan_each ("set").to_a
24622484 # # => ["key1", "key2", "key3"]
24632485 #
24642486 # @param [Hash] options
0 commit comments