Created
May 18, 2009 19:52
-
-
Save patmaddox/113704 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
| module Muahaha | |
| def self.included(target) | |
| target.class_eval do | |
| instance_methods.each do |m| | |
| next if m.to_s.include?("__") || m.to_s == "send" | |
| alias_method "old_#{m}", m | |
| eval <<-END | |
| def #{m}(*args, &block) | |
| return if rand > 0.95 | |
| send("old_#{m}", *args, &block) | |
| end | |
| END | |
| end | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment