Catching calls to an undefined method
suggest changeclass Animal
def method_missing(method, *args, &block)
"Cannot call #{method} on Animal"
end
end
=> Animal.new.say_moo
> "Cannot call say_moo on Animal"
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents