Sha256: e2a9c32cab5208a54f5631b24501cb148975a3bba17a489edd0478721f09778c

Contents?: true

Size: 502 Bytes

Versions: 21

Compression:

Stored size: 502 Bytes

Contents

# frozen_string_literal: true

module N1Loader
  module ArLazyPreload
    # A patch to {N1Loader::Preloader} setup lazy context lazily.
    module PreloaderPatch
      def initialize(elements, context_setup = nil)
        super(elements)
        @context_setup = context_setup
      end

      def preload(*keys)
        super.each do |loader_collection|
          loader_collection.context_setup = context_setup
        end
      end

      private

      attr_reader :context_setup
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
n1_loader-1.7.4 lib/n1_loader/ar_lazy_preload/preloader_patch.rb
n1_loader-1.7.3 lib/n1_loader/ar_lazy_preload/preloader_patch.rb
n1_loader-1.7.2 lib/n1_loader/ar_lazy_preload/preloader_patch.rb
n1_loader-1.7.1 lib/n1_loader/ar_lazy_preload/preloader_patch.rb
n1_loader-1.7.0 lib/n1_loader/ar_lazy_preload/preloader_patch.rb
n1_loader-1.6.6 lib/n1_loader/ar_lazy_preload/preloader_patch.rb
n1_loader-1.6.5 lib/n1_loader/ar_lazy_preload/preloader_patch.rb
n1_loader-1.6.4 lib/n1_loader/ar_lazy_preload/preloader_patch.rb
n1_loader-1.6.3 lib/n1_loader/ar_lazy_preload/preloader_patch.rb
n1_loader-1.6.2 lib/n1_loader/ar_lazy_preload/preloader_patch.rb
n1_loader-1.6.1 lib/n1_loader/ar_lazy_preload/preloader_patch.rb
n1_loader-1.6.0 lib/n1_loader/ar_lazy_preload/preloader_patch.rb
n1_loader-1.5.1 lib/n1_loader/ar_lazy_preload/preloader_patch.rb
n1_loader-1.5.0 lib/n1_loader/ar_lazy_preload/preloader_patch.rb
n1_loader-1.4.4 lib/n1_loader/ar_lazy_preload/preloader_patch.rb
n1_loader-1.4.3 lib/n1_loader/ar_lazy_preload/preloader_patch.rb
n1_loader-1.4.2 lib/n1_loader/ar_lazy_preload/preloader_patch.rb
n1_loader-1.4.1 lib/n1_loader/ar_lazy_preload/preloader_patch.rb
n1_loader-1.4.0 lib/n1_loader/ar_lazy_preload/preloader_patch.rb
n1_loader-1.3.0 lib/n1_loader/ar_lazy_preload/preloader_patch.rb