class Restruct::Queue
Public Instance Methods
empty?()
click to toggle source
# File lib/restruct/queue.rb, line 18 def empty? size == 0 end
pop()
click to toggle source
# File lib/restruct/queue.rb, line 8 def pop deserialize connection.lazy('LPOP', id) end
push(object)
click to toggle source
# File lib/restruct/queue.rb, line 4 def push(object) connection.lazy 'RPUSH', id, serialize(object) end
size()
click to toggle source
# File lib/restruct/queue.rb, line 12 def size connection.call 'LLEN', id end
to_a()
click to toggle source
# File lib/restruct/queue.rb, line 22 def to_a connection.call('LRANGE', id, 0, -1).map { |o| deserialize o } end
Also aliased as: to_primitive
Private Instance Methods
deserialize(string)
click to toggle source
# File lib/restruct/queue.rb, line 33 def deserialize(string) string end
serialize(string)
click to toggle source
# File lib/restruct/queue.rb, line 29 def serialize(string) string end