# File lib/familia/redisobject.rb, line 361 def << v push v end
# File lib/familia/redisobject.rb, line 382 def [] idx, count=nil if idx.is_a? Range range idx.first, idx.last elsif count case count <=> 0 when 1 then range(idx, idx + count - 1) when 0 then [] when -1 then nil end else at idx end end
# File lib/familia/redisobject.rb, line 462 def at idx from_redis redis.lindex(rediskey, idx) end
# File lib/familia/redisobject.rb, line 446 def collect &blk range.collect &blk end
# File lib/familia/redisobject.rb, line 454 def collectraw &blk rangeraw.collect &blk end
# File lib/familia/redisobject.rb, line 397 def delete v, count=0 redis.lrem rediskey, count, to_redis(v) end
def revmembers count=1 #TODO
range -count, 0
end
# File lib/familia/redisobject.rb, line 430 def each &blk range.each &blk end
# File lib/familia/redisobject.rb, line 434 def each_with_index &blk range.each_with_index &blk end
# File lib/familia/redisobject.rb, line 438 def eachraw &blk rangeraw.each &blk end
# File lib/familia/redisobject.rb, line 442 def eachraw_with_index &blk rangeraw.each_with_index &blk end
# File lib/familia/redisobject.rb, line 349 def empty? size == 0 end
# File lib/familia/redisobject.rb, line 413 def members count=-1 echo :members, caller[0] if Familia.debug count -= 1 if count > 0 range 0, count end
# File lib/familia/redisobject.rb, line 421 def membersraw count=-1 count -= 1 if count > 0 rangeraw 0, count end
# File lib/familia/redisobject.rb, line 374 def pop from_redis redis.rpop(rediskey) end
# File lib/familia/redisobject.rb, line 353 def push *values echo :push, caller[0] if Familia.debug values.flatten.compact.each { |v| redis.rpush rediskey, to_redis(v) } redis.ltrim rediskey, -@opts[:maxlength], -1 if @opts[:maxlength] update_expiration self end
# File lib/familia/redisobject.rb, line 404 def range sidx=0, eidx=-1 el = rangeraw sidx, eidx multi_from_redis *el end
# File lib/familia/redisobject.rb, line 409 def rangeraw sidx=0, eidx=-1 redis.lrange(rediskey, sidx, eidx) end
# File lib/familia/redisobject.rb, line 450 def select &blk range.select &blk end
# File lib/familia/redisobject.rb, line 458 def selectraw &blk rangeraw.select &blk end
# File lib/familia/redisobject.rb, line 378 def shift from_redis redis.lpop(rediskey) end
# File lib/familia/redisobject.rb, line 344 def size redis.llen rediskey end
Generated with the Darkfish Rdoc Generator 2.