INNER CODE UNIT · Ruby

batch

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

  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

  def respond_to?(method_name, include_private = false)
    return true if LEFT_INSTANCE_METHODS.include?(method_name)

    __loaded_value.respond_to?(method_name, include_private)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…