Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRubymethod_missing dispatch internalsSingle-choice MCQ

A class defines method_missing that calls method_missing for an undefined name via the default dispatch but never defines the method. What does respond_to? and method() report for that name?

class Ghost def method_missing(name, *) = "ghost:#{name}" end g = Ghost.new p g.respond_to?(:foo) p g.foo g.method(:foo)