Created
January 3, 2011 03:42
-
-
Save janx/763096 to your computer and use it in GitHub Desktop.
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
class A | |
def method_missing(m, *args) | |
n = m.to_s.split('_')[1].to_i | |
send "print_#{n-1}" | |
puts n | |
end | |
def print_1 | |
puts 1 | |
end | |
end | |
A.new.print_1000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment