Module: Zeitwerk::Registry::Inceptions

Defined in:
lib/zeitwerk/registry/inceptions.rb

Overview

Loaders know their own inceptions, but there is a use case in which we need to know if a given cpath is an inception globally. This is what this registry is for.

Class Method Summary collapse

Class Method Details

.clearObject



26
27
28
# File 'lib/zeitwerk/registry/inceptions.rb', line 26

def clear # for tests
  @inceptions.clear
end

.register(cref, autoload_path) ⇒ Object



11
12
13
# File 'lib/zeitwerk/registry/inceptions.rb', line 11

def register(cref, autoload_path)
  @inceptions[cref] = autoload_path
end

.registered?(cref) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/zeitwerk/registry/inceptions.rb', line 16

def registered?(cref)
  @inceptions[cref]
end

.unregister(cref) ⇒ Object



21
22
23
# File 'lib/zeitwerk/registry/inceptions.rb', line 21

def unregister(cref)
  @inceptions.delete(cref)
end