Created
August 26, 2013 23:50
Revisions
-
logiblocs created this gist
Aug 26, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ # Monkeypatching like a boss class Array def do_def(&block) self.each do |method| Kernel.send :define_method, method, &block end end end # Think you can print anything. You must be stupid [:print, :printf, :puts].do_def do | *args | nice_names = ["pony", "fairy"] # Fill in with your own words i = Random.rand(nice_names.length) $stdout.puts "I'm not printing anything for you. Do it yourself you lazy #{nice_names[i]}." end