Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRubymethod_missing and respond_to_missingSingle-choice MCQ

A class defines method_missing to handle any call, but does NOT define respond_to_missing?. What does calling obj.method(:anything) return for a name the class handles only via method_missing?

class Ghost def method_missing(name, *args) "ghost: #{name}" end end g = Ghost.new puts g.anything # works m = g.method(:anything) # ???