INNER CODE UNIT · Ruby

initialize

exAspArk/batch-loader · lib/batch_loader.rb:21

  def initialize(item:, executor_proxy: nil)
    @item = item
    @__executor_proxy = executor_proxy
  end

  def batch(default_value: nil, cache: true, replace_methods: nil, key: nil, &batch_block)
    @default_value = default_value
    @cache = cache
    @replace_methods = replace_methods.nil? ? cache : replace_methods
    @key = key
    @batch_block = batch_block

    __executor_proxy.add(item: @item)

    __singleton_class.class_eval { undef_method(:batch) }

    self
  end

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…