Sha256: 32b83bc5576d31eb9b933530d28166fecaf74388519fa1fe024769273bd39f54
Contents?: true
Size: 513 Bytes
Versions: 19
Compression:
Stored size: 513 Bytes
Contents
# frozen_string_literal: true module N1Loader # The class is used for storing collections of loaders for elements per set of arguments. class LoaderCollection attr_reader :loader_class, :elements def initialize(loader_class, elements) @loader_class = loader_class @elements = elements end def with(**args) loader = loader_class.new(elements, **args) loaders[loader.cache_key] ||= loader end private def loaders @loaders ||= {} end end end
Version data entries
19 entries across 19 versions & 1 rubygems