Created
July 25, 2009 03:51
-
-
Save jaredatron/154683 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 Ass | |
| def self.make_a_method(name, *org_args) | |
| class_eval do | |
| def temp_method(*args, &block) | |
| puts args.inspect | |
| puts org_args.inspect | |
| puts block_given?.inspect | |
| puts yield.inspect | |
| end | |
| end | |
| class_eval %( | |
| alias_method :#{name}, :temp_method | |
| remove_method :temp_method | |
| ) | |
| end | |
| end | |
| class Butt < Ass | |
| make_a_method :fart, 'in','your','face','ruby',69 | |
| end | |
| a = Butt.new | |
| a.fart 'in','your','face' do | |
| 'no way' | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment