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.202.2 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.202.1 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.202.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.201.5 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.201.4 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.201.3 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.201.2 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.201.1 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.201.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.200.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.199.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.198.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.197.2 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.197.1 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.197.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.194.1 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.194.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.193.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.192.1 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.192.0 lib/aws-sdk-core/eager_loader.rb