class Redis
def zrevrangebyscore(key, max, min, options = {})
- See: #zrangebyscore -
Other tags:
- Example: Retrieve members and their scores with scores `> 5` -
Example: Retrieve the first 2 members with score `<= 0` -
Example: Retrieve members with score `< 100` and `>= 5` -
def zrevrangebyscore(key, max, min, options = {}) args = [] with_scores = options[:with_scores] || options[:withscores] args.concat ["WITHSCORES"] if with_scores limit = options[:limit] args.concat ["LIMIT", *limit] if limit synchronize do |client| client.call [:zrevrangebyscore, key, max, min, *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