class BatchLoader::Executor

Constants

NAMESPACE

Attributes

items_by_block[R]
loaded_values_by_block[R]

Public Class Methods

clear_current() click to toggle source
# File lib/batch_loader/executor.rb, line 15
def self.clear_current
  Thread.current[NAMESPACE] = nil
end
current() click to toggle source
# File lib/batch_loader/executor.rb, line 11
def self.current
  Thread.current[NAMESPACE]
end
ensure_current() click to toggle source
# File lib/batch_loader/executor.rb, line 7
def self.ensure_current
  Thread.current[NAMESPACE] ||= new
end
new() click to toggle source
# File lib/batch_loader/executor.rb, line 21
def initialize
  @items_by_block = Hash.new { |hash, key| hash[key] = Set.new }
  @loaded_values_by_block = Hash.new { |hash, key| hash[key] = {} }
end