-
-
Save Sebx/b4c10bdc6d9e7e605e7b9fb8f71bb1f5 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