Class: Raheui::Queue

Inherits:
Store
  • Object
show all
Defined in:
lib/raheui/queue.rb

Overview

Queue class for Aheui.

Instance Method Summary collapse

Methods inherited from Store

#initialize, #push_dup

Constructor Details

This class inherits a constructor from Raheui::Store

Instance Method Details

#popObject

Dequeue from the Queue.



10
11
12
# File 'lib/raheui/queue.rb', line 10

def pop
  @store.shift
end

#swapObject

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