Last active
December 13, 2018 02:28
-
-
Save hackvan/1d6368d01826fe1abbcc2b89208779f1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MethodCatcher | |
def method_missing(name, *args, &block) | |
puts "El nombre del método no encontrado es #{name}" | |
puts "los argumentos del método son #{args}" | |
puts "El cuerpo del método es #{block.inspect}" | |
end | |
end | |
catch = MethodCatcher.new | |
catch.some_method(1, 2) { puts "something" } | |
# El nombre del método no encontrado es some_method | |
# los argumentos del método son [1, 2] | |
# El cuerpo del método es #<Proc:0x0033...> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment