Class: Aws::EagerLoader Private
- Inherits:
-
Object
- Object
- Aws::EagerLoader
- 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
- #loaded ⇒ Set<Module> readonly private
Instance Method Summary collapse
-
#initialize ⇒ EagerLoader
constructor
private
A new instance of EagerLoader.
- #load(klass_or_module) ⇒ self private
Constructor Details
#initialize ⇒ EagerLoader
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
#loaded ⇒ Set<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.
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.
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 |