Sha256: 89a2e458100bb0108501510591bd7ad9ba6143d609ab6c5c90641d8a2fe5aa7e

Contents?: true

Size: 681 Bytes

Versions: 197

Compression:

Stored size: 681 Bytes

Contents

# frozen_string_literal: true

require 'set'

module Aws
  # @api private
  class EagerLoader

    def initialize
      @loaded = Set.new
    end

    # @return [Set<Module>]
    attr_reader :loaded

    # @param [Module] klass_or_module
    # @return [self]
    def load(klass_or_module)
      @loaded << klass_or_module
      klass_or_module.constants.each do |const_name|
        path = klass_or_module.autoload?(const_name)
        begin
          require(path) if path
          const = klass_or_module.const_get(const_name)
          self.load(const) if Module === const && !@loaded.include?(const)
        rescue LoadError
        end
      end
      self
    end
  end
end

Version data entries

197 entries across 197 versions & 1 rubygems

Version Path
aws-sdk-core-3.171.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.170.1 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.170.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.169.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.168.4 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.168.3 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.168.2 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.168.1 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.168.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.167.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.166.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.165.1 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.165.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.164.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.163.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.162.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.161.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.160.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.159.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.158.1 lib/aws-sdk-core/eager_loader.rb