Ruby - Metaprogramming Fundamentals
Given this class, what will obj.foo.bar(1) output?
class CatchAll
def method_missing(name, *args)
if name == :bar
"Handled bar with #{args[0]}"
else
self
end
end
end
obj = CatchAll.new
puts obj.foo.bar(1)