Class: Lunar::SortedResultSet
Instance Attribute Summary
Attributes inherited from ResultSet
#key
Instance Method Summary
collapse
Methods inherited from ResultSet
#each, #initialize
Instance Method Details
#all(options = {}) ⇒ Object
18
19
20
21
22
23
24
|
# File 'lib/lunar/result_set.rb', line 18
def all(options = {})
start = Integer(options[:start] || 0)
limit = Integer(options[:limit] || 0)
finish = start + limit - 1
Lunar.redis.zrevrange(key, start, finish).map(&@block)
end
|
#size ⇒ Object
26
27
28
|
# File 'lib/lunar/result_set.rb', line 26
def size
Lunar.redis.zcard(key)
end
|