Created
March 2, 2015 20:07
-
-
Save peijiehu/595b13a92e333e356fab to your computer and use it in GitHub Desktop.
override method_missing and accepts multiple arguments
This file contains 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
def method_missing(method_sym, *arguments) | |
if arguments.empty? | |
puts method_sym | |
else | |
puts "#{method_sym}(#{arguments.join(',')})" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment