Class: GptFunction::SimpleQueue
- Inherits:
-
Object
- Object
- GptFunction::SimpleQueue
- Defined in:
- lib/gpt_function/simple_queue.rb
Instance Method Summary collapse
- #dequeue ⇒ Object
- #enqueue(value) ⇒ Object
-
#initialize ⇒ SimpleQueue
constructor
A new instance of SimpleQueue.
Constructor Details
#initialize ⇒ SimpleQueue
Returns a new instance of SimpleQueue.
5 6 7 |
# File 'lib/gpt_function/simple_queue.rb', line 5 def initialize @queue = [] end |
Instance Method Details
#dequeue ⇒ Object
14 15 16 |
# File 'lib/gpt_function/simple_queue.rb', line 14 def dequeue @queue.shift end |
#enqueue(value) ⇒ Object
9 10 11 12 |
# File 'lib/gpt_function/simple_queue.rb', line 9 def enqueue(value) @queue << value true end |