Class: GptFunction::SimpleQueue

Inherits:
Object
  • Object
show all
Defined in:
lib/gpt_function/simple_queue.rb

Instance Method Summary collapse

Constructor Details

#initializeSimpleQueue

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

#dequeueObject



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