class Restruct::Queue

Public Instance Methods

count()
Alias for: size
empty?() click to toggle source
# File lib/restruct/queue.rb, line 18
def empty?
  size == 0
end
length()
Alias for: size
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
Also aliased as: count, length
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
to_primitive()
Alias for: to_a

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