From: Michael Klishin Date: 2011-07-09T23:13:47+09:00 Subject: [ruby-core:37923] [Ruby 1.9 - Feature #5005] Provide convenient access to original methods Issue #5005 has been updated by Michael Klishin. Ondrej, When module is included into a class, Ruby adds a new anonymous (in a sense that it will be skipped by Class#superclass calls) class into the inheritance chain: https://gist.github.com/1073599. So it is appending, not prepending. This is useless for core classes like String, however, most cases of blatant monkey-patching that I see look more like this: https://gist.github.com/1073605. In that case, aliased methods is a reinvented wheel. ---------------------------------------- Feature #5005: Provide convenient access to original methods http://redmine.ruby-lang.org/issues/5005 Author: Lazaridis Ilias Status: Open Priority: Normal Assignee: Category: core Target version: 2.0 The languag allows a class to be "reopened", thus it's behaviour can be redefined: class String def any_method #custom code end end the original method can be called, using this construct: class String alias_method :original_any_method, :any_method def any_method(*args) #custom code original_any_method(*args) #custom code end end In order to make this more convenient, the following construct could be provided: class String def any_method(*args) #custom code original # call the original String#any_method, passing *args (similar to "super") #custom code end end "original" would behave similar to "super" The term "original" can be replaced by any term which describes this concept better. -- http://redmine.ruby-lang.org