Module: GptFunction::Storage

Defined in:
lib/gpt_function/storage.rb

Class Method Summary collapse

Class Method Details

.batch_storageObject



15
16
17
# File 'lib/gpt_function/storage.rb', line 15

def batch_storage
  @batch_storage
end

.batch_storage=(value) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/gpt_function/storage.rb', line 6

def batch_storage=(value)
  # 檢查 value 有實作 enqueue 方法
  raise "Invalid batch storage: should respond to #enqueue" unless value.respond_to?(:enqueue)

  # 檢查 value 有實作 dequeue 方法
  raise "Invalid batch storage: should respond to #dequeue" unless value.respond_to?(:dequeue)
  @batch_storage = value
end