Skip to content

Instantly share code, notes, and snippets.

@casper
Created September 1, 2011 02:46
Show Gist options
  • Save casper/1185316 to your computer and use it in GitHub Desktop.
Save casper/1185316 to your computer and use it in GitHub Desktop.
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