Skip to content

Instantly share code, notes, and snippets.

@casper
Created September 1, 2011 02:46
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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