Skip to content

Instantly share code, notes, and snippets.

@bertomartin
Created April 13, 2014 04:42
Show Gist options
  • Save bertomartin/10569518 to your computer and use it in GitHub Desktop.
Save bertomartin/10569518 to your computer and use it in GitHub Desktop.
class Foo
def huge
puts "huge"
end
end
module Bar
def new_huge
puts "small"
end
def self.included(base)
base.send(:alias_method, :original_huge, :huge)
base.send(:alias_method, :huge, :new_huge)
end
end
Foo.send(:include, Bar)
Foo.new.huge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment