Module: Vedeu::Queue
Instance Method Summary collapse
- #dequeue ⇒ Object
- #enqueue(result) ⇒ Object
- #enqueued? ⇒ Boolean
- #entries ⇒ Object
- #reset ⇒ Object
- #size ⇒ Object
- #view ⇒ Object
Instance Method Details
#dequeue ⇒ Object
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
15 16 17 |
# File 'lib/vedeu/support/queue.rb', line 15 def enqueued? store.size > 0 end |
#entries ⇒ Object
19 20 21 |
# File 'lib/vedeu/support/queue.rb', line 19 def entries store end |
#reset ⇒ Object
27 28 29 |
# File 'lib/vedeu/support/queue.rb', line 27 def reset store.clear end |
#size ⇒ Object
23 24 25 |
# File 'lib/vedeu/support/queue.rb', line 23 def size store.size end |
#view ⇒ Object
31 32 33 |
# File 'lib/vedeu/support/queue.rb', line 31 def view store.inspect end |