INNER CODE UNIT · Ruby
initialize
exAspArk/batch-loader · lib/batch_loader/executor_proxy.rb:9
def initialize(default_value, key, &block)
@default_value = default_value
@block = block
@block_hash_key = [block.source_location, key]
@global_executor = BatchLoader::Executor.ensure_current
end
def add(item:)
items_to_load << item
end
def list_items
items_to_load.to_a.freeze
end
def delete(items:)
global_executor.items_by_block[@block_hash_key] = items_to_load - items
end