Method: Redis#zrevrange
- Defined in:
- lib/redis.rb
#zrevrange(key, start, stop, options = {}) ⇒ Object
Return a range of members in a sorted set, by index, with scores ordered from high to low.
953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 |
# File 'lib/redis.rb', line 953 def zrevrange(key, start, stop, = {}) args = [] with_scores = [:with_scores] || [:withscores] args << "WITHSCORES" if with_scores synchronize do @client.call [:zrevrange, key, start, stop, *args] do |reply| if with_scores if reply reply.each_slice(2).map do |member, score| [member, Float(score)] end end else reply end end end end |