Class: Aws::EagerLoader Private

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-sdk-core/eager_loader.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEagerLoader

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of EagerLoader.



9
10
11
# File 'lib/aws-sdk-core/eager_loader.rb', line 9

def initialize
  @loaded = Set.new
end

Instance Attribute Details

#loadedSet<Module> (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Set<Module>)


14
15
16
# File 'lib/aws-sdk-core/eager_loader.rb', line 14

def loaded
  @loaded
end

Instance Method Details

#load(klass_or_module) ⇒ self

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • klass_or_module (Module)

Returns:

  • (self)


18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/aws-sdk-core/eager_loader.rb', line 18

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