Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRubyconst_missing included inherited hooksSingle-choice MCQ

Defining `Object.const_missing` as shown makes a reference to a bare, undefined top-level constant resolve through it. Why does a top-level constant reference end up at `Object.const_missing`?

class Object def self.const_missing(name) "global-missing:#{name}" end end NoSuchTopLevelConst # => "global-missing:NoSuchTopLevelConst"