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 Nyan | |
def replace_method(a, b) | |
(class << self; self end).module_exec do | |
alias_method "#{a}_backup", a | |
alias_method "#{b}_backup", b | |
alias_method b, "#{a}_backup" | |
alias_method a, "#{b}_backup" | |
end | |
end |
OlderNewer