Method: Containers::PriorityQueue#pop
- Defined in:
- lib/containers/priority_queue.rb
#pop ⇒ Object Also known as: next!
call-seq:
pop -> object
Return the object with the next highest priority and removes it from the queue
q = Containers::PriorityQueue.new
q.push("Alaska", 50)
q.push("Delaware", 30)
q.push("Georgia", 35)
q.pop #=> "Alaska"
q.size #=> 2
113 114 115 |
# File 'lib/containers/priority_queue.rb', line 113 def pop @heap.pop end |