Skip to content

Commit 5b25870

Browse files
committed
Rename pop_array method to take.
1 parent 3481a67 commit 5b25870

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

lib/pqueue.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
#
1818
class PQueue
1919

20+
#
21+
VERSION = "2.0.0" #:erb: VERSION = "<%= version %>"
22+
2023
#
2124
# Returns a new priority queue.
2225
#
@@ -148,12 +151,10 @@ def concat(elements)
148151
#
149152
alias :merge! :concat
150153

151-
# TODO: rename #pop_array or support n argument #pop itself.
152-
153154
#
154155
# Return top n-element as a sorted array.
155156
#
156-
def pop_array(n=@size)
157+
def take(n=@size)
157158
a = []
158159
n.times{a.push(pop)}
159160
a

0 commit comments

Comments
 (0)