Skip to content

Instantly share code, notes, and snippets.

@janx
Created January 3, 2011 03:42
Show Gist options
  • Save janx/763096 to your computer and use it in GitHub Desktop.
Save janx/763096 to your computer and use it in GitHub Desktop.
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