From: "mame (Yusuke Endoh)" Date: 2012-03-25T16:44:24+09:00 Subject: [ruby-core:43647] [ruby-trunk - Feature #5005][Assigned] Provide convenient access to original methods Issue #5005 has been updated by mame (Yusuke Endoh). Status changed from Open to Assigned Assignee set to matz (Yukihiro Matsumoto) ---------------------------------------- Feature #5005: Provide convenient access to original methods https://bugs.ruby-lang.org/issues/5005#change-25147 Author: lazaridis.com (Lazaridis Ilias) Status: Assigned Priority: Normal Assignee: matz (Yukihiro Matsumoto) Category: Target version: 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://bugs.ruby-lang.org/