From: "ko1 (Koichi Sasada)" Date: 2012-06-26T04:00:17+09:00 Subject: [ruby-core:45840] [ruby-trunk - Feature #1102] Prepend Module Issue #1102 has been updated by ko1 (Koichi Sasada). Assignee changed from ko1 (Koichi Sasada) to nobu (Nobuyoshi Nakada) Nobu will commit it. ---------------------------------------- Feature #1102: Prepend Module https://bugs.ruby-lang.org/issues/1102#change-27418 Author: trans (Thomas Sawyer) Status: Feedback Priority: Normal Assignee: nobu (Nobuyoshi Nakada) Category: Target version: 2.0.0 =begin Currently when a module is included into a classes, it is appended to the class hierarchy (ie. the method lookup order). This of course makes sense, but there are times when it would be useful to *prepend* the module. For example: class C def x; "x"; end end module M def x; '[' + super + ']'; end end class C prepend M end C.new.x #=> "[x]" One big advantage of this is being able to override methods in a safer way, rather than using alias or tricks like alias_method_chain. =end -- http://bugs.ruby-lang.org/