Class: Raheui::Queue
Overview
Queue class for Aheui.
Instance Method Summary collapse
-
#pop ⇒ Object
Dequeue from the Queue.
-
#swap ⇒ Object
Swap the first two elements of Queue.
Methods inherited from Store
Constructor Details
This class inherits a constructor from Raheui::Store
Instance Method Details
#pop ⇒ Object
Dequeue from the Queue.
10 11 12 |
# File 'lib/raheui/queue.rb', line 10 def pop @store.shift end |
#swap ⇒ Object
Swap the first two elements of Queue.
15 16 17 |
# File 'lib/raheui/queue.rb', line 15 def swap @store[0], @store[1] = @store[1], @store[0] if size > 1 end |