Created
September 1, 2011 02:46
-
-
Save casper/1185316 to your computer and use it in GitHub Desktop.
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
module Fix | |
module ClassMethods | |
def fixit | |
alias_method :fixed, :fixme | |
end | |
end | |
def self.included(base) | |
base.extend(ClassMethods) | |
end | |
end | |
class Foo | |
include Fix | |
def fixme | |
puts "bacon" | |
end | |
fixit | |
end | |
Foo.new.fixed # -> prints "bacon" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment