Ruby - Metaprogramming Fundamentals
Given this code, what will obj.foo.bar output?
class CatchAll
def method_missing(name, *args)
puts "Called #{name} with #{args.inspect}"
self
end
end
obj = CatchAll.new
obj.foo.barGiven this code, what will obj.foo.bar output?
class CatchAll
def method_missing(name, *args)
puts "Called #{name} with #{args.inspect}"
self
end
end
obj = CatchAll.new
obj.foo.bar15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions