Ruby - Metaprogramming Fundamentals
What will this Ruby code print?
class CatchAll
def method_missing(name, *args)
if name.to_s.start_with?('say_')
"You said: #{args.join(' ')}"
else
super
end
end
end
obj = CatchAll.new
puts obj.say_hello('Ruby')