Class: Queue
- Inherits:
-
Object
- Object
- Queue
- Defined in:
- lib/chinese_vocab/core_ext/queue.rb
Instance Method Summary collapse
-
#pop! ⇒ Object
Return nil if queue is empty.
- #to_a ⇒ Object
Instance Method Details
#pop! ⇒ Object
Return nil if queue is empty.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/chinese_vocab/core_ext/queue.rb', line 12 def pop! pop(non_block = true) rescue ThreadError => e case e. when /queue empty/ nil else raise end end |
#to_a ⇒ Object
7 8 9 |
# File 'lib/chinese_vocab/core_ext/queue.rb', line 7 def to_a @que end |