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

A proxy defines method_missing and respond_to_missing? (true only for names starting with "find_"). What is the result of `proxy.method(:find_user)` versus `proxy.method(:other)`?

class Proxy def method_missing(name, *args) = "dynamic: #{name}" def respond_to_missing?(name, include_private = false) name.to_s.start_with?("find_") end end proxy = Proxy.new proxy.method(:find_user) # ? proxy.method(:other) # ?