Module: Zeitwerk::ExplicitNamespace

Extended by:
Internal, RealModName
Includes:
Synchronized
Defined in:
lib/zeitwerk/explicit_namespace.rb

Overview

This module is essentially a registry for explicit namespaces.

When a loader determines that a certain file should define an explicit namespace, it registers it here, associating its cref with itself.

If the namespace is autoloaded, our const_added callback retrieves its loader by calling loader_for. That way, the loader is able to scan the subdirectories that conform the namespace and set autoloads for their expected constants just in time.

Once autoloaded, the namespace is unregistered.

The implementation assumes an explicit namespace is managed by one loader. Loaders that reopen namespaces owned by other projects are responsible for loading their constant before setup. This is documented.

Defined Under Namespace

Modules: Synchronized

Constant Summary

Constants included from Synchronized

Synchronized::MUTEX

Method Summary

Methods included from RealModName

real_mod_name

Methods included from Internal

internal