Class: Lunar::UnsortedResultSet

Inherits:
ResultSet show all
Defined in:
lib/lunar/result_set.rb

Instance Attribute Summary

Attributes inherited from ResultSet

#key

Instance Method Summary collapse

Methods inherited from ResultSet

#each, #initialize

Constructor Details

This class inherits a constructor from Lunar::ResultSet

Instance Method Details

#all(options = {}) ⇒ Object



32
33
34
35
36
37
# File 'lib/lunar/result_set.rb', line 32

def all(options = {})
  start  = Integer(options[:start] || 0)
  limit  = Integer(options[:limit] || 100)
  
  Lunar.redis.sort(key, :limit => [start, limit]).map(&@block)
end

#sizeObject



39
40
41
# File 'lib/lunar/result_set.rb', line 39

def size
  Lunar.redis.scard(key)
end