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.183.1 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.183.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.182.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.181.1 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.181.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.180.3 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.180.2 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.180.1 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.180.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.179.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.178.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.177.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.176.1 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.176.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.175.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.174.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.173.1 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.173.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.172.0 lib/aws-sdk-core/eager_loader.rb
aws-sdk-core-3.171.1 lib/aws-sdk-core/eager_loader.rb