Module: Kernel::WithModuleConstResolutionExtension

Defined in:
lib/utilrb/kernel/with_module.rb

Instance Method Summary collapse

Instance Method Details

#const_missing(const_name) ⇒ Object


4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/utilrb/kernel/with_module.rb', line 4

def const_missing(const_name)
    if with_module_setup = Thread.current[:__with_module__]
        if consts = with_module_setup.last
            consts.each do |mod|
                if mod.const_defined?(const_name)
                    return mod.const_get(const_name)
                end
            end
        end
    end
    super
end