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

This class defines method_missing but NOT respond_to_missing?. What happens at the marked line?

class Ghost def method_missing(name, *) = "handled #{name}" end g = Ghost.new g.anything # => "handled anything" g.method(:anything) # <-- this line