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.191.6 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.191.5 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.191.4 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.191.3 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.191.2 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.191.1 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.191.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.190.3 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.190.2 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.190.1 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.190.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.189.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.188.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.187.1 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.187.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.186.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.185.2 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.185.1 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.185.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.184.0 lib/aws-sdk-core/eager_loader.rb