Class: Hamster::MutableQueue Private
- Inherits:
-
Object
- Object
- Hamster::MutableQueue
- Includes:
- ReadCopyUpdate
- Defined in:
- lib/hamster/experimental/mutable_queue.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
- .[](*items) ⇒ Object private
Instance Method Summary collapse
- #dequeue ⇒ Object private
- #enqueue(item) ⇒ Object private
Methods included from ReadCopyUpdate
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Hamster::ReadCopyUpdate
Class Method Details
.[](*items) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/hamster/experimental/mutable_queue.rb', line 9 def self.[](*items) MutableQueue.new(Deque[*items]) end |
Instance Method Details
#dequeue ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 20 21 22 23 24 |
# File 'lib/hamster/experimental/mutable_queue.rb', line 17 def dequeue head = nil transform do |queue| head = queue.head queue.dequeue end head end |
#enqueue(item) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 |
# File 'lib/hamster/experimental/mutable_queue.rb', line 13 def enqueue(item) transform { |queue| queue.enqueue(item) } end |