Module: Vedeu::Queue

Extended by:
Queue
Included in:
Interface, Queue
Defined in:
lib/vedeu/support/queue.rb

Instance Method Summary collapse

Instance Method Details

#dequeueObject



5
6
7
# File 'lib/vedeu/support/queue.rb', line 5

def dequeue
  store.pop
end

#enqueue(result) ⇒ Object



9
10
11
12
13
# File 'lib/vedeu/support/queue.rb', line 9

def enqueue(result)
  store.unshift(result)

  self
end

#enqueued?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/vedeu/support/queue.rb', line 15

def enqueued?
  store.size > 0
end

#entriesObject



19
20
21
# File 'lib/vedeu/support/queue.rb', line 19

def entries
  store
end

#resetObject



27
28
29
# File 'lib/vedeu/support/queue.rb', line 27

def reset
  store.clear
end

#sizeObject



23
24
25
# File 'lib/vedeu/support/queue.rb', line 23

def size
  store.size
end

#viewObject



31
32
33
# File 'lib/vedeu/support/queue.rb', line 31

def view
  store.inspect
end